At 09:03 AM 6/10/2002, Sander Striker wrote:
>Why is PHP even using its own memory allocation scheme?  It would be much
>easier to just use pools and point out where it doesn't work for you.

Because we don't want it depend on any underlying services which aren't 
available in all servers.  We can say that in general, the no-free 
allocation scheme doesn't work at all with PHP, so the pool approach cannot 
be used.  Even if we could use it, though, all of the services of the 
memory allocator are still necessary at the PHP level so we can provide 
them outside the scope of Apache 2.

What we need for efficient thread-safe operation is a mechanism like the 
Win32 heaps - mutexless heaps, that provide malloc and free services on a 
(preferably) contiguous pre-allocated block of memory.  The question is 
whether the APR allocators fall into that category:

1.  Can you make them mutexless completely?  I.e., will they never call 
malloc()?
2.  They definitely do provide alloc/free services, we're ok there
3.  As far as I can tell, they don't use a contiguous block of memory, 
which means more fragmentation...

Zeev

Zeev


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to