Re: Smart strings & memory allocation

From: Date: Wed, 18 Jun 2003 14:16:49 +0000
Subject: Re: Smart strings & memory allocation
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-2372@lists.php.net to get a copy of this message
(I don't have the time right now to write a lengthy reply) 1. malloc is expensive on some systems, and less expensive on many others. It really depends. 2. some mallocs (Linux, Solaris probably) are optimized for non-contentious allocations in threaded contexts (thread-specific memory arenas). 3. some mallocs (Linux) don't use binary fixed size chunks for small allocations (e.g. they won't allocate 128 bytes for a 80 byte chunk) 4. but some do (FreeBSD) 5. locking up memory in PHP and asserting that you basically would like to reroute malloc to go through PHP's emalloc does not sound reasonable to me. - Sascha

« previous php.internals (#2372) next »