httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: palloc without a pool
Date Tue, 14 Sep 1999 16:16:40 GMT


On Wed, 8 Sep 1999, Greg Stein wrote:

> If ap_palloc() can take on arbitrary schemes and one of those includes a
> bare malloc(), then doesn't that imply that we must always call a free?
> (because we don't know of the ap_palloc used a pool or not)  In other
> words, just what Dean said: the abstraction seems to be destroyed.
> 
> I'm in favor of Dean's suggestion: don't use a free. ap_palloc() always
> registers a cleanup for the memory item (where the memory came from).

that wasn't quite my suggestion.  i was suggesting two allocation
interfaces... one ap_malloc/ap_free, the other ap_palloc.

ap_malloc would register a cleanup (after all, it is a pool, it's meant to
handle resource tracking)... but ap_free could be used prior to the
cleanups. 

Dean


Mime
View raw message