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]

Re: [PATCH] PPC32 Linuxthreads Chance MALLOC_ALIGNMENT for VMX


Hi,

I didn't receive Steve's posting (only Ulrich's reply), but I'd like
to answer the following:

> Steve Munroe wrote:
> 
> > Would it be acceptable to extent malloc.c to allow MALLOC_ALIGNMENT to be 
> > changes at runtime via mallopt? Then for power we can detect VMX in 
> > dl_hwcap and change the alignment only on the hardware that requires it!

You can't change MALLOC_ALIGNMENT at runtime without significant
performance drop, the assumption that it is a constant is rather
fundamental in the code.

It would be much better to create a separate malloc.o implementation
with a different MALLOC_ALIGNMENT value, probably in a special DSO.

As to whether to care for this at all: I agree with Andreas that the C
standard talks about "any type of object", so as soon as it becomes
sufficiently easy/widespread to create "VMX" objects, malloc would
need to support the extended alignment.  You would waste some memory,
however (e.g. there couldn't be 24byte chunks, only 32byte ones), so
the explicit use of posix_memalign() would still be better from a
performance point of view.

Regards,
Wolfram.


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