Problem with malloc on PA
Ulrich Drepper
drepper@redhat.com
Wed Apr 25 15:42:00 GMT 2001
willy@ldl.fc.hp.com (Matthew Wilcox) writes:
> malloc() currently returns pointers which are 8-byte aligned. Would it
> be possible to change it so that they're 16-byte aligned?
Not in general, but for PA, yes.
> I took a quick look at the code, and I saw MALLOC_ALIGN_MASK, but
> I'm not sure exactly what effects simply changing this would have.
> I suspect I would want to change MALLOC_ALIGNMENT as well, but not
> SIZE_SZ?
What type does gcc return __alignof__(type) == 16 for? We should be
able to define
#define MALLOC_ALIGNMENT MAX(SIZE_SZ + SIZE_SZ, __alignof__(type))
The rest should then fall into place.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------
More information about the Libc-alpha
mailing list