You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Stas Bekman <st...@stason.org> on 2004/01/28 22:03:56 UTC

apr_realloc?

I couldn't find apr_realloc() in the apr API. Is that on purpose or just 
wasn't needed so far?

I suppose realloc is hard in the pool architecture, since if you have 
allocated something after the alloc, you have to move the already allocated 
memory.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: apr_realloc?

Posted by Stas Bekman <st...@stason.org>.
Sander Striker wrote:
> On Wed, 2004-01-28 at 22:03, Stas Bekman wrote:
> 
>>I couldn't find apr_realloc() in the apr API. Is that on purpose or just 
>>wasn't needed so far?
>>
>>I suppose realloc is hard in the pool architecture, since if you have 
>>allocated something after the alloc, you have to move the already allocated 
>>memory.
> 
> apr_prealloc aswell as apr_pfree are doable.  I can take a look at
> revisiting my earlier patches if there is enough interest.

I've found a workaround for now. But I may need one in the future, so yes, if 
you can add it that would be great.

Thanks.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: apr_realloc?

Posted by Ben Laurie <be...@algroup.co.uk>.
Sander Striker wrote:

> On Wed, 2004-01-28 at 22:03, Stas Bekman wrote:
> 
>>I couldn't find apr_realloc() in the apr API. Is that on purpose or just 
>>wasn't needed so far?
>>
>>I suppose realloc is hard in the pool architecture, since if you have 
>>allocated something after the alloc, you have to move the already allocated 
>>memory.
> 
> 
> apr_prealloc aswell as apr_pfree are doable.  I can take a look at
> revisiting my earlier patches if there is enough interest.

It was an issue for the prng, too.

-- 
http://www.apache-ssl.org/ben.html       http://www.thebunker.net/

"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff

Re: apr_realloc?

Posted by Klaus Keppler <kl...@informatik.stud.uni-erlangen.de>.
> apr_prealloc aswell as apr_pfree are doable.  I can take a look at
> revisiting my earlier patches if there is enough interest.

*Pling* - interested!

I was already wondering why there's no apr_pfree... when I want to
allocate buffer memory from a pool with apr_palloc the only way to
get rid of it is creating a subpool and destroying that afterwards;
in some cases quite unnecessary...

Klaus



Re: apr_realloc?

Posted by Branko Čibej <br...@xbc.nu>.
Sander Striker wrote:

>On Wed, 2004-01-28 at 22:03, Stas Bekman wrote:
>  
>
>>I couldn't find apr_realloc() in the apr API. Is that on purpose or just 
>>wasn't needed so far?
>>
>>I suppose realloc is hard in the pool architecture, since if you have 
>>allocated something after the alloc, you have to move the already allocated 
>>memory.
>>    
>>
>
>apr_prealloc aswell as apr_pfree are doable.  I can take a look at
>revisiting my earlier patches if there is enough interest.
>  
>
apr_prealloc would be nice, I know at least one place in SVN where we
could use it, and probably a few places in APR, too. apr_pfree could be
useful as a minor optimization instead of creating and destroying a subpool.

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/

Re: apr_realloc?

Posted by Sander Striker <st...@apache.org>.
On Wed, 2004-01-28 at 22:03, Stas Bekman wrote:
> I couldn't find apr_realloc() in the apr API. Is that on purpose or just 
> wasn't needed so far?
> 
> I suppose realloc is hard in the pool architecture, since if you have 
> allocated something after the alloc, you have to move the already allocated 
> memory.

apr_prealloc aswell as apr_pfree are doable.  I can take a look at
revisiting my earlier patches if there is enough interest.

Sander