diff options
Diffstat (limited to 'malloc/malloc-debug.c')
-rw-r--r-- | malloc/malloc-debug.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/malloc/malloc-debug.c b/malloc/malloc-debug.c index 3867d15..da9d234 100644 --- a/malloc/malloc-debug.c +++ b/malloc/malloc-debug.c @@ -299,7 +299,14 @@ __debug_memalign (size_t alignment, size_t bytes) return _debug_mid_memalign (alignment, bytes, RETURN_ADDRESS (0)); } strong_alias (__debug_memalign, memalign) -strong_alias (__debug_memalign, aligned_alloc) +static void * +__debug_aligned_alloc (size_t alignment, size_t bytes) +{ + if (!powerof2 (alignment) || alignment == 0) + return NULL; + return _debug_mid_memalign (alignment, bytes, RETURN_ADDRESS (0)); +} +strong_alias (__debug_aligned_alloc, aligned_alloc) static void * __debug_pvalloc (size_t bytes) |