apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: apr_palloc: What about apr_pfree?
Date Fri, 27 Jun 2003 23:44:47 GMT
On Fri, Jun 27, 2003 at 01:42:10PM -0700, Aaron Bannert wrote:
> 
> On Tuesday, June 24, 2003, at 08:41  PM, HOR wrote:
> >	There is a possibility of the APR team add a function like
> >
> >/** Free the given pointer.  */
> >APR_DECLARE(void *) apr_pfree(apr_pool_t *pool, void *pointer)
> >
> >to the current pool system? AFAIK it is only possible to deallocate 
> >memory
> >deallocating the whole pool.
> >
> >	I missing something obvious here?!
> 
> If you need malloc()/free() semantics, then you should just use
> malloc() and free(). Pools are designed to minimize and amortize the 
> cost
> of managing the free list in a way that performs very well with short
> lived "pools" of memory allocation.

Right.

I've checked in a document which talks about the "proper" pattern of using
pools. You can see the doc at:

    http://cvs.apache.org/viewcvs/*checkout*/apr/docs/pool-design.html


Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message