apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Striker <stri...@apache.org>
Subject RE: Memory pools -- support for moving a sub-pool from one pool t o an other
Date Thu, 08 Jan 2004 08:02:23 GMT
On Thu, 2004-01-08 at 03:35, Dipak Patel wrote: 
> Sander and Cliff,
> Thank you for your feedback. 
> My comment:
> >We are considering the use of APR memory pool feature in our commercial
> product but I have >not been too impressed with the supportout there ..
> was based on not hearing back from anyone since my first e-mail on this
> subject dated December 4,2003.

I only see one mail prior to this one and it is a one liner on Dec 17,
2003.  The question was also phrased somewhat rethorical.

> We actually have two functions in our code:
> moveTree(srcPool, dstPool) and moveItem(srcItem, dstPool). The moveItem()
> takes an allocated buffer and binds it as a child of the dstPool. I
> understand that this may have to be implemented by first allocating a buffer
> --say dstItem-- of size srcItem in the dstPool and then doing a copy and
> then freeing the srcItem. Does APR allow me to find out the size of the
> srcItem if I just have the srcItem pointer.

No.  The memory returned by apr_palloc doesn't have any recorded size associated
with it.  The only thing you might be able to deduce is the size of the containing
block of memory.  But that may be a LOT larger than what you are looking for.
Also, the concept of 'freeing the srcItem' isn't possible.  There is no
apr_pfree function.

Moving an entire subpool to a new parent pool should be less of a problem
as I said earlier.

> Please let me know if you can help with the above two items so that we can
> integrate and test APR pools in our code. Thanks.

I'm a bit pressed for time at the moment.


View raw message