implement support for C11 aligned_alloc

Just like glibc does, we simply alias it to memalign.
This commit is contained in:
Aliaksey Kandratsenka 2017-08-05 22:05:10 -07:00
parent 92a27e41a1
commit d406f22853
3 changed files with 3 additions and 0 deletions

View File

@ -97,6 +97,7 @@ endif OSX
if HAVE_OBJCOPY_WEAKEN
WEAKEN = $(OBJCOPY) -W malloc -W free -W realloc -W calloc -W cfree \
-W memalign -W posix_memalign -W valloc -W pvalloc \
-W aligned_alloc \
-W malloc_stats -W mallopt -W mallinfo -W nallocx \
-W _Znwm -W _ZnwmRKSt9nothrow_t -W _Znam -W _ZnamRKSt9nothrow_t \
-W _ZdlPv -W _ZdaPv \

View File

@ -143,6 +143,7 @@ extern "C" {
void* calloc(size_t n, size_t size) __THROW ALIAS(tc_calloc);
void cfree(void* ptr) __THROW ALIAS(tc_cfree);
void* memalign(size_t align, size_t s) __THROW ALIAS(tc_memalign);
void* aligned_alloc(size_t align, size_t s) __THROW ALIAS(tc_memalign);
void* valloc(size_t size) __THROW ALIAS(tc_valloc);
void* pvalloc(size_t size) __THROW ALIAS(tc_pvalloc);
int posix_memalign(void** r, size_t a, size_t s) __THROW

View File

@ -71,6 +71,7 @@ extern "C" {
void* calloc(size_t n, size_t s) { return tc_calloc(n, s); }
void cfree(void* p) { tc_cfree(p); }
void* memalign(size_t a, size_t s) { return tc_memalign(a, s); }
void* aligned_alloc(size_t a, size_t s) { return tc_memalign(a, s); }
void* valloc(size_t s) { return tc_valloc(s); }
void* pvalloc(size_t s) { return tc_pvalloc(s); }
int posix_memalign(void** r, size_t a, size_t s) {