Replaced glib memory allocation

This commit is contained in:
Dan Hirsch 2012-10-10 15:58:03 +02:00
parent 6101b8c43a
commit d5729efa1f
33 changed files with 414 additions and 166 deletions

20
src/system_allocator.c Normal file
View file

@ -0,0 +1,20 @@
#include <malloc.h>
#include "internal.h"
static void* system_alloc(HAllocator *allocator, size_t size) {
return malloc(size);
}
static void* system_realloc(HAllocator *allocator, void* ptr, size_t size) {
return realloc(ptr, size);
}
static void system_free(HAllocator *allocator, void* ptr) {
free(ptr);
}
HAllocator system_allocator = {
.alloc = system_alloc,
.realloc = system_realloc,
.free = system_free,
};