apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Fritsch ...@sfritsch.de>
Subject Re: bug 54572 -- move struct crypt_data allocation to heap
Date Sat, 23 Mar 2013 16:01:51 GMT
On Saturday 16 March 2013, Jeff Trawick wrote:
> This would be good to resolve in 1.5.2.
> Has anyone else evaluated this?  I'm suspicious of the use of a
> global pool in the reporter's patch vs. just using malloc()
> directly.  I guess the reason for using the pool is that the
> allocator may have suitable buffers lying around, but you need one
> for the pool and one for the structure instead of just getting one
> from malloc().  I haven't tried any performance tests yet.

An alternative would be using apr_allocator_alloc() directly (with the 
global pool's allocator). Creating a sub-pool seems more overhead than 
necessary. Not sure what is better, malloc() or apr_allocator_alloc().

View raw message