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
