apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject Re: cvs commit: apr/strings apr_strings.c
Date Sun, 11 Feb 2001 17:40:04 GMT

--- 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'.

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

--Cliff


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Mime
View raw message