Implement free()
This commit is contained in:
parent
62720625ae
commit
bd9ba0085f
|
@ -64,9 +64,7 @@ void *calloc(size_t count, size_t size) {
|
|||
__ensure(!"Not implemented");
|
||||
__builtin_unreachable();
|
||||
}
|
||||
void free(void *pointer) {
|
||||
__ensure(!"Not implemented");
|
||||
}
|
||||
// free() is provided by the platform
|
||||
// malloc() is provided by the platform
|
||||
void *realloc(void *pointer, size_t size) {
|
||||
__ensure(!"Not implemented");
|
||||
|
|
|
@ -44,6 +44,10 @@ void __mlibc_initMalloc() {
|
|||
memoryAllocator.initialize(virtualAllocator);
|
||||
}
|
||||
|
||||
void free(void *pointer) {
|
||||
memoryAllocator->free(pointer);
|
||||
}
|
||||
|
||||
void *malloc(size_t size) {
|
||||
// FIXME: initialize malloc from a global library guard constructor
|
||||
if(!memoryAllocator)
|
||||
|
|
Loading…
Reference in a new issue