Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
implement support for C11 aligned_alloc
Just like glibc does, we simply alias it to memalign.
  • Loading branch information
alk committed Sep 17, 2017
1 parent 92a27e4 commit d406f22
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions src/libc_override_gcc_and_weak.h
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/libc_override_redefine.h
Expand Up @@ -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) {
Expand Down

0 comments on commit d406f22

Please sign in to comment.