Re: Adding path_len to all stream functions in trunk

From: Date: Tue, 16 Nov 2010 11:31:48 +0000
Subject: Re: Adding path_len to all stream functions in trunk
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-50244@lists.php.net to get a copy of this message
On Tue, Nov 16, 2010 at 6:07 AM, Stas Malyshev <smalyshev@sugarcrm.com> wrote: > Hi! > >> Yeah, I thought about that too.  Still not something we can do without >> breaking binary compatibility in the 5.3 branch though and I really >> would like to at least get all the core functions to guard themselves >> against null-poisoning there. > > How adding a new option char to zend_parse_parameters breaks BC? That's something I like to have as well. For two main reasons: - avoid painful and repetitive path cleaning (VCWD&co) - may save some memory ops (alloc, free, dup) while a file will not be processed many times by each part of the engine - exts do a check, then stream and TSRM at the end. That's expensive and should be removed A possible solution would be to return a struct with a smart str ptr for the given path, the resolved path and some custom OS specific data (like stats info, permissions, etc.). Doing so each information about a given path will be requested/generated only once. Cheers, -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org

« previous php.internals (#50244) next »