This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Alignment of malloc returned pointer
- From: Ramana <ramana dot venkat83 at gmail dot com>
- To: libc-alpha at sourceware dot org
- Date: Thu, 11 Dec 2014 16:20:01 +0530
- Subject: Alignment of malloc returned pointer
- Authentication-results: sourceware.org; auth=none
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