This commit is contained in:
2025-10-03 20:55:18 +02:00
parent 5fed6d24d8
commit 8ada613a3e
3 changed files with 34 additions and 34 deletions
+17 -17
View File
@@ -1,32 +1,32 @@
#include "allocator.h"
static void *stdlib_alloc(void *this, size_t bytes, const char *file, int line) {
(void)this;
(void)file;
(void)line;
return malloc(bytes);
(void)this;
(void)file;
(void)line;
return malloc(bytes);
}
static void *stdlib_resize(void *this, void *old_ptr, size_t bytes, const char *file, int line) {
(void)this;
(void)file;
(void)line;
return realloc(old_ptr, bytes);
(void)this;
(void)file;
(void)line;
return realloc(old_ptr, bytes);
}
static void stdlib_free(void *this, void *ptr, const char *file, int line) {
(void)this;
(void)file;
(void)line;
free(ptr);
(void)this;
(void)file;
(void)line;
free(ptr);
}
static const allocator_vtbl_t stdlib_vtbl = {
.alloc = stdlib_alloc,
.resize = stdlib_resize,
.free = stdlib_free,
.alloc = stdlib_alloc,
.resize = stdlib_resize,
.free = stdlib_free,
};
const allocator_t allocator_stdlib = (allocator_t) {
.this=NULL,
.vtbl=&stdlib_vtbl,
.this=NULL,
.vtbl=&stdlib_vtbl,
};