Re: String Size Refactor Progress

From: Date: Wed, 03 Jul 2013 22:59:13 +0000
Subject: Re: String Size Refactor Progress
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi!


> The problem is that changing 's' from int to size_t can (and does) cause
> segfaults.

But if we refactor string lengths to be size_t, we can not allow code
that still relies on it being int, if sizeof(size_t) != sizeof(int). It
would just produce wrong length. I'd actually prefer segfault there at
least for testing phase because segfault is obvious while wrong length
would be much harder to catch.

> We can have the discussion if 's' and 'p' should remain there (and if the
> compile time option should be there) at merge time, but for now the switch
> just makes life easier making the change. It wasn't designed for a
> long-term switch...

OK, if it's a temp measure, that's fine, but if we're taking strings to
use size_t, then in the final code it should use size_t in the API
functions everywhere, otherwise there would be a lot of weird bugs.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227


Thread (9 messages)

« previous php.internals (#68063) next »