Michael Brown
c4677c7e73
Implemented realloc(), and changed the semantics of malloc(0) to allow
for realloc(0) being a valid way to free memory.
před 18 roky
Michael Brown
88e38fa148
We don't actually have a stdio.h header file. Our printf() functions are
defined in vsprintf.h. (This may change, since vsprintf.h is a
non-standard name, but for now it's the one to use.)
There should be no need to include vsprintf.h just for DBG() statements,
since include/compiler.h forces it in for a debug build anyway.
před 18 roky
Marty Connor
1da4faa896
include stdio.h to suppress printf warning, general warnings fixups
před 18 roky
Michael Brown
1dbafa8950
Tidied up debugging messages
před 18 roky
Michael Brown
689218618f
Fix typo
před 18 roky
Michael Brown
51feeab445
Add an explicit failure debug message
před 18 roky
Michael Brown
cfae86f6c8
Glenn managed to shrink .text by 5 more bytes.
před 18 roky
Michael Brown
face774c4c
Fixed erroneous comparison
před 18 roky
Michael Brown
95f8a42930
Removed incorrect comment; malloc() is inefficient only when the
alignment and size are both powers of two, and there's no way to
specify an alignment through the malloc() interface anyway.
před 18 roky
Michael Brown
4e92f29c9e
Now passes trivial tests. free_memblock() needs neatening up.
před 18 roky
Michael Brown
b601a7d355
Updated memory allocator to improve support for unaligned or partially
aligned blocks.
Moved header to include/malloc.h, since we now also provide the
POSIX-like malloc()/free() pair.
Not yet tested.
před 18 roky
Michael Brown
b6b6a0b5fe
First draft of a dynamic memory allocator
před 18 roky