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]

Re: Problem with malloc on PA


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   `------------------------


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