On Wed, 6 Mar 2002, Stas Bekman wrote:

> Doug, didn't you say that we should always use apr_.?alloc functions for 
> malloc'ing? Or is it OK to use it?

yes, in general, apr_.?alloc should be used.

> I see it used twice in the mod_perl sources:
> 
> 1. in modperl_perl_destruct() in src/modules/perl/modperl_perl.c

read the comment there.

> 2. in mpxs_apr_uuid_alloc() in xs/APR/UUID/APR__UUID.h

in c programs apr_uuid_t is allocated from the stack:

apr_uuid_t uuid:
apr_uuid_get(&uuid);

the xs wrapper cannot return stack allocation, so we need to malloc.
i did not want to add a pool argument for the function since the c version 
does not have one.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to