Implement free()

This commit is contained in:
avdgrinten 2015-12-06 22:12:00 +01:00
parent 62720625ae
commit bd9ba0085f
2 changed files with 5 additions and 3 deletions

View file

@ -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");

View file

@ -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)