#include "../../include/std/alloc.h" #include int am_malloc(usize size, void **mem) { void *allocated_data = malloc(size); if(!allocated_data) return ALLOC_FAIL; *mem = allocated_data; return ALLOC_OK; } int am_realloc(void *mem, usize new_size, void **new_mem) { void *new_allocated_data = realloc(mem, new_size); if(!new_allocated_data) return ALLOC_FAIL; *new_mem = new_allocated_data; return ALLOC_OK; } void am_free(void *mem) { free(mem); }