Alignment of malloc returned pointer

Ramana ramana.venkat83@gmail.com
Thu Dec 11 10:50:00 GMT 2014


Hi,

In glibc, I understand that the alignment of the pointer returned by
malloc is aligned to at least __alignof__ (long double). For our
target, we want to have a different version of malloc that return the
pointer with less alignment compared to __alignof__ (long double) and
leave the existing malloc version as is.

1) Is it possible to have two versions of malloc in glibc i.e. one
with at least __alignof__ (long double) and other with less alignment?
2) If possible, can I just copy the existing '__libc_malloc'
implementation and tweak it to arrive at the other malloc version with
less alignment?
3) Is there anything in particular that I need to care about for the
two malloc versions to co-exist and function properly?

Thanks,
Venkata Ramanaiah N



More information about the Libc-alpha mailing list