X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=opt%2Fdlmalloc%2Fdlmalloc.c;h=54703d480f5c5e89acf656a0f11c6a691930c107;hp=865b5b95afa46c04084dc241ceff38589d160b17;hb=da0f3f353d417fed71f358a48d5d5394145e460d;hpb=3a988bf47bda2322d7759d3c4518c03e0ef98ba4 diff --git a/opt/dlmalloc/dlmalloc.c b/opt/dlmalloc/dlmalloc.c index 865b5b9..54703d4 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 @@ -6258,7 +6258,7 @@ History: #endif #ifdef TEST -#include <_PDCLIB_test.h> +#include "_PDCLIB_test.h" /* TODO: TEST ME */ int main( void )