Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 80556 invoked by uid 500); 12 Feb 2001 02:58:46 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 80542 invoked from network); 12 Feb 2001 02:58:45 -0000 X-Authentication-Warning: kurgan.lyra.org: gstein set sender to gstein@lyra.org using -f Date: Sun, 11 Feb 2001 19:00:51 -0800 From: Greg Stein To: dev@apr.apache.org Subject: Re: cvs commit: apr/strings apr_strings.c Message-ID: <20010211190051.B26044@lyra.org> Mail-Followup-To: dev@apr.apache.org References: <20010211161809.71701.qmail@apache.org> <20010211174004.9123.qmail@web3202.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20010211174004.9123.qmail@web3202.mail.yahoo.com>; from cliffwoolley@yahoo.com on Sun, Feb 11, 2001 at 09:40:04AM -0800 X-URL: http://www.lyra.org/greg/ X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N 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/