Replaced glib memory allocation
This commit is contained in:
parent
6101b8c43a
commit
d5729efa1f
33 changed files with 414 additions and 166 deletions
20
src/system_allocator.c
Normal file
20
src/system_allocator.c
Normal 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,
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue