This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

obstack default alignment


There appears to be inconsistency in the alignment of memory returned
by different memory allocation routines in libc. Specifically malloc
is defined to allocate memory that is aligned to hold any data type.
(Which to me seems to be sane behaviour.)

By constrast obstack_alloc is defined to return memory aligned to 4 bytes.
*But* it actually calculates default alignmnet to be big enough to hold a
double (which is often the largest alignment needed, but not on Itanium).

I would have thought it made sense to set the default alignment in the same
way as malloc(). However failing shouldn't the code actually implement the
docs and set the alignment to 4, rather than calculating?

Cheers,

Benno


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]