On Sun, Feb 11, 2001 at 09:40:04AM -0800, Cliff Woolley wrote:
> 
> --- [EMAIL PROTECTED] wrote:
> >   +APR_DECLARE(void *) apr_memdup(apr_pool_t *a, const void *m, apr_size_t 
> > n)
> >   +{
> >   +    void *res;
> >   +
> >   +    if(m == NULL)
> >   + return NULL;
> >   +    res = apr_palloc(a, n);
> >   +    memcpy(res, m, n);
> >   +    return res;
> >   +}
> >   +
> 
> Nice.  Minor question, though: why is this called "apr_memdup" instead of 
> "apr_pmemdup"? 
> I thought all of the "like the standard function, but into a pool instead of 
> the heap"
> functions were prefixed with a 'p'.

You're right. I've just changed it.

> Also, should it check for failure of apr_palloc, or is that being too anal?

We never check for failure to alloc. The program terminates instead.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Reply via email to