diff options
Diffstat (limited to 'libc/stdlib/malloc-930716/malloc.h')
-rw-r--r-- | libc/stdlib/malloc-930716/malloc.h | 27 |
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); + + |