summaryrefslogtreecommitdiff
path: root/libc/stdlib/malloc-930716/malloc.h
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-09-05 05:54:26 +0000
committerEric Andersen <andersen@codepoet.org>2002-09-05 05:54:26 +0000
commitccf964b4c2b384d4e005a358f781e49cd6f89c68 (patch)
tree05c2b332ff646da2c0c7736f5551e0126d239874 /libc/stdlib/malloc-930716/malloc.h
parente72144d6265637d1e34bd79f5e373b4ff98d4d29 (diff)
split-out memalign and realloc
-Erik
Diffstat (limited to 'libc/stdlib/malloc-930716/malloc.h')
-rw-r--r--libc/stdlib/malloc-930716/malloc.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/libc/stdlib/malloc-930716/malloc.h b/libc/stdlib/malloc-930716/malloc.h
index fc21a13cc..bd315f788 100644
--- a/libc/stdlib/malloc-930716/malloc.h
+++ b/libc/stdlib/malloc-930716/malloc.h
@@ -10,6 +10,15 @@
#include <sys/cdefs.h>
+
+#define MIN(x,y) ({ \
+ const typeof(x) _x = (x); \
+ const typeof(y) _y = (y); \
+ (void) (&_x == &_y); \
+ _x < _y ? _x : _y; })
+
+
+
/* The allocator divides the heap into blocks of fixed size; large
requests receive one or more whole blocks, and small requests
receive a fragment of a block. Fragment sizes are powers of two,
@@ -60,3 +69,21 @@ struct list {
struct list *prev;
};
+/* List of blocks allocated with memalign or valloc */
+struct alignlist
+{
+ struct alignlist *next;
+ __ptr_t aligned; /* The address that memaligned returned. */
+ __ptr_t exact; /* The address that malloc returned. */
+};
+extern struct alignlist *_aligned_blocks;
+extern char *_heapbase;
+extern union info *_heapinfo;
+extern size_t _heapindex;
+extern size_t _heaplimit;
+
+
+extern void *__malloc_unlocked (size_t size);
+extern void __free_unlocked(void *ptr);
+
+