]> pd.if.org Git - pdclib/blobdiff - opt/dlmalloc/dlmalloc.c
Pulled in aligned_alloc from dlmalloc.c (dlmemalign).
[pdclib] / opt / dlmalloc / dlmalloc.c
index 865b5b95afa46c04084dc241ceff38589d160b17..dd1126a26874a9bcb2cee80db6965cd5395cfd5b 100644 (file)
@@ -814,7 +814,7 @@ extern "C" {
 #define dlcalloc               calloc\r
 #define dlfree                 free\r
 #define dlmalloc               malloc\r
-#define dlmemalign             memalign\r
+#define dlmemalign             aligned_alloc\r
 #define dlposix_memalign       posix_memalign\r
 #define dlrealloc              realloc\r
 #define dlrealloc_in_place     realloc_in_place\r
@@ -893,6 +893,20 @@ DLMALLOC_EXPORT void* dlcalloc(size_t, size_t);
 */\r
 DLMALLOC_EXPORT void* dlrealloc(void*, size_t);\r
 \r
+/*\r
+  memalign(size_t alignment, size_t n);\r
+  Returns a pointer to a newly allocated chunk of n bytes, aligned\r
+  in accord with the alignment argument.\r
+\r
+  The alignment argument should be a power of two. If the argument is\r
+  not a power of two, the nearest greater power is used.\r
+  8-byte alignment is guaranteed by normal malloc calls, so don't\r
+  bother calling memalign with an argument of 8 or less.\r
+\r
+  Overreliance on memalign is a sure way to fragment space.\r
+*/\r
+DLMALLOC_EXPORT void* dlmemalign(size_t, size_t);\r
+\r
 #endif\r
 \r
 /*\r
@@ -910,20 +924,6 @@ DLMALLOC_EXPORT void* dlrealloc(void*, size_t);
 */\r
 DLMALLOC_EXPORT void* dlrealloc_in_place(void*, size_t);\r
 \r
-/*\r
-  memalign(size_t alignment, size_t n);\r
-  Returns a pointer to a newly allocated chunk of n bytes, aligned\r
-  in accord with the alignment argument.\r
-\r
-  The alignment argument should be a power of two. If the argument is\r
-  not a power of two, the nearest greater power is used.\r
-  8-byte alignment is guaranteed by normal malloc calls, so don't\r
-  bother calling memalign with an argument of 8 or less.\r
-\r
-  Overreliance on memalign is a sure way to fragment space.\r
-*/\r
-DLMALLOC_EXPORT void* dlmemalign(size_t, size_t);\r
-\r
 /*\r
   int posix_memalign(void** pp, size_t alignment, size_t n);\r
   Allocates a chunk of n bytes, aligned in accord with the alignment\r