Files
Upsilon/lib/malloc.c
Romain Goyet 525f2aef9f Proper malloc/free/realloc
SQLite's memory allocator make assertions that we have to fulfill
2015-05-25 13:06:41 +02:00

20 lines
325 B
C

#include <stddef.h>
void free(void *ptr) {
if (ptr != NULL) {
memsys5FreeUnsafe(ptr);
}
}
void * malloc(int size) {
void * p = NULL;
if (size > 0) {
p = memsys5MallocUnsafe(memsys5Roundup(size));
}
return p;
}
void * realloc(void *ptr, int size) {
return memsys5Realloc(ptr, memsys5Roundup(size));
}