apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: cvs commit: apr/strings apr_strings.c
Date Mon, 12 Feb 2001 03:00:51 GMT
On Sun, Feb 11, 2001 at 09:40:04AM -0800, Cliff Woolley wrote:
> 
> --- ben@apache.org 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/

Mime
View raw message