Initial commit

This commit is contained in:
2026-05-25 15:15:52 -06:00
commit 50406e3819
6 changed files with 203 additions and 0 deletions

29
src/allocator.c Normal file
View File

@@ -0,0 +1,29 @@
#include "allocator.h"
#include <stdlib.h>
static void *stdlib_alloc(void *ctx, size_t size) {
(void)ctx;
return malloc(size);
}
static void *stdlib_realloc(void *ctx, void *ptr, size_t old_size,
size_t new_size) {
(void)ctx;
(void)old_size;
return realloc(ptr, new_size);
}
static void stdlib_free(void *ctx, void *ptr, size_t size) {
(void)ctx;
(void)size;
free(ptr);
}
Allocator allocator_default(void) {
return (Allocator){
.ctx = NULL,
.alloc = stdlib_alloc,
.realloc = stdlib_realloc,
.free = stdlib_free,
};
}

5
src/main.c Normal file
View File

@@ -0,0 +1,5 @@
#include "allocator.h"
#include <stdio.h>
#include <stdlib.h>
int main(void) { return EXIT_SUCCESS; }