Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 96646 invoked by uid 500); 11 Aug 2001 16:27:05 -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 Delivered-To: moderator for dev@apr.apache.org Received: (qmail 56980 invoked from network); 11 Aug 2001 07:16:21 -0000 Date: Sat, 11 Aug 2001 00:16:33 -0700 From: Aaron Bannert To: dev@apr.apache.org Subject: Re: use of malloc in dso.c instead of apr_palloc? Message-ID: <20010811001633.A22820@clove.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from sterling@designmultimedia.com on Sat, Aug 11, 2001 at 12:25:11PM -0400 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N On Sat, Aug 11, 2001 at 12:25:11PM -0400, Sterling Hughes wrote: > > Well, as the overly long title suggests, is there any reason that > malloc() is used in dso.c (unix and aix)? apr_palloc() seems > fine for these purposes (temporary string). Also, as a side > note, sizeof(char) is used in the allocation, which is extreaneous, > because a char is always equivalent to one base unit of memory > (well, at least that's how I interpret ANSII). If I remember my compiler class correctly, sizeof() gives a constant scalar at compile-time. Any decent compiler will perform constant folding on expressions like (sizeof(char)*12) before producing object code. This means you should feel free to use sizeof() liberally if it helps readability. -aaron