Adrian Stan wrote:
Pool based allocation is good for some class of applications indeed, but the library should be flexible enough to allow the user to specify his own memory allocation scheme (or not to use one at all and to directly allocate memory on the heap using malloc)
I've never tried this, but would it not be enough to create a pool, use the pool, and then destroy the pool directly afterwards if necessary?
The existence of pools significantly simplifies a lot of APR, because you no longer need to keep track of whether a buffer you have been given needs to be freed or not.
As a result, if a function needs to return a static string (for argument's sake), it will just return the static string, instead of returning a malloc'ed copy of the static string so that when the caller calls free it will always work.
Regards, Graham --
smime.p7s
Description: S/MIME Cryptographic Signature
