Hi, I have a question of aligning the 'size' in apr_pCalloc() [apr_pools.c].

apr_pCalloc() calls apr_palloc() to do the memory allocation in the
pool. It aligns the 'size' parameter before calling apr_palloc(). And
the size is aligned again in apr_palloc().

Why 'size' has to be aligned twice? Can the first alignment ( in
apr_pCalloc() ) be omitted?

I don't think omitting the first alignment will affect the memset()
call later in apr_pCalloc(), because, from the users' point of view,
it's guaranteed that all the memory he can see has been Zero-out.

Thanks!

Reply via email to