On Thu, 31 Mar 2005, Sander Striker wrote: > Ryan Bloom wrote: > > I really don't think we should take a function like apr_pcalloc and > > convert it to a macro. The only reason to go to a macro is for > > performance reasons. First, the performance boost should be > > relatively minimal, and for anybody who needs it, they can use > > apr_palloc and memset themselves. > > apr_pcalloc has been a macro for a very very long time now. The > performance boost was significant is my recollection. This is why > we converted to the macro.
... the reason for which would have been that memset's of a fixed length that is known at compile time can be optimized. If pcalloc is a macro, and the length argument to pcalloc is a constant, then having pcalloc as a macro means that the compiler will be able to see that constant for what it is.
