X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=opt%2Fdlmalloc%2Fdlmalloc.c;h=dd1126a26874a9bcb2cee80db6965cd5395cfd5b;hp=865b5b95afa46c04084dc241ceff38589d160b17;hb=e921387af8d68b18babcd7e098b97479965b7663;hpb=81b6302395f77a0d4e0771cb9e1cef80188d9474 diff --git a/opt/dlmalloc/dlmalloc.c b/opt/dlmalloc/dlmalloc.c index 865b5b9..dd1126a 100644 --- a/opt/dlmalloc/dlmalloc.c +++ b/opt/dlmalloc/dlmalloc.c @@ -814,7 +814,7 @@ extern "C" { #define dlcalloc calloc #define dlfree free #define dlmalloc malloc -#define dlmemalign memalign +#define dlmemalign aligned_alloc #define dlposix_memalign posix_memalign #define dlrealloc realloc #define dlrealloc_in_place realloc_in_place @@ -893,6 +893,20 @@ DLMALLOC_EXPORT void* dlcalloc(size_t, size_t); */ DLMALLOC_EXPORT void* dlrealloc(void*, size_t); +/* + memalign(size_t alignment, size_t n); + Returns a pointer to a newly allocated chunk of n bytes, aligned + in accord with the alignment argument. + + The alignment argument should be a power of two. If the argument is + not a power of two, the nearest greater power is used. + 8-byte alignment is guaranteed by normal malloc calls, so don't + bother calling memalign with an argument of 8 or less. + + Overreliance on memalign is a sure way to fragment space. +*/ +DLMALLOC_EXPORT void* dlmemalign(size_t, size_t); + #endif /* @@ -910,20 +924,6 @@ DLMALLOC_EXPORT void* dlrealloc(void*, size_t); */ DLMALLOC_EXPORT void* dlrealloc_in_place(void*, size_t); -/* - memalign(size_t alignment, size_t n); - Returns a pointer to a newly allocated chunk of n bytes, aligned - in accord with the alignment argument. - - The alignment argument should be a power of two. If the argument is - not a power of two, the nearest greater power is used. - 8-byte alignment is guaranteed by normal malloc calls, so don't - bother calling memalign with an argument of 8 or less. - - Overreliance on memalign is a sure way to fragment space. -*/ -DLMALLOC_EXPORT void* dlmemalign(size_t, size_t); - /* int posix_memalign(void** pp, size_t alignment, size_t n); Allocates a chunk of n bytes, aligned in accord with the alignment