harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garrett Rooney <roo...@electricjellyfish.net>
Subject Re: Windows support
Date Wed, 11 May 2005 14:46:40 GMT
Stefano Mazzocchi wrote:

> For the APR-impared between me (me, for example) could you elaborate a 
> little more what this means?

Currently APR requires that all memory allocation be done within a 
"pool".  You don't malloc and free memory directly, you allocate within 
the pool, then either clear it (allowing the memory to be reused all in 
one shot), or destroy it (passing the memory back to the OS).  Pools are 
hierarchical, so you can create child pools that are intended to be used 
for temporary allocations.  The end result is less memory bookkeeping, 
but the program tends to use more memory because you're not cleaning it 
up ASAP.  Pools are also used to manage other resources (network 
sockets, file handles, etc) and even arbitrary user defined resources 
via callbacks.

This fits very well with the way something like the Apache HTTPD works, 
where you might have a bunch of resources that are scoped to the 
request, but after the request you can just throw them all away.  It 
doesn't necessarily fit with the use patterns of other programs, so Ryan 
is suggesting that it would be worthwhile to make the use of pools in 
APR optional in some way.


View raw message