From 467746b30e566bd4587c43b7cc1cf317acb76e46 Mon Sep 17 00:00:00 2001 From: NukeBird Date: Tue, 2 Dec 2025 20:04:53 +0300 Subject: [PATCH] Actually nah, don't wanna mimic stdlib (it causes more harm than good) --- axl_memory.h | 9 --------- axl_string.h | 12 ------------ main.c | 11 +++++------ 3 files changed, 5 insertions(+), 27 deletions(-) diff --git a/axl_memory.h b/axl_memory.h index f87fd1d..b551fbb 100644 --- a/axl_memory.h +++ b/axl_memory.h @@ -15,13 +15,4 @@ void* axl_memcpy(void* dst, const void* src, u32 count); i32 axl_memcmp(const void* s1, const void* s2, u32 n); void axl_free(void* ptr); -#ifdef AXL_MIMIC_STDLIB -#define malloc axl_malloc -#define realloc axl_realloc -#define memset axl_memset -#define memcpy axl_memcpy -#define memcmp axl_memcmp -#define free axl_free -#endif - #endif diff --git a/axl_string.h b/axl_string.h index 3f2c586..9cdd49c 100644 --- a/axl_string.h +++ b/axl_string.h @@ -12,16 +12,4 @@ i32 axl_strncmp(const i8* s1, const i8* s2, u32 n); const i8* axl_strchr(const i8* str, i8 c); i8* axl_strstr(const i8* str, const i8* substr); -#ifdef AXL_MIMIC_STDLIB -#define strlen axl_strlen -#define strcpy axl_strcpy -#define strncpy axl_strncpy -#define strcat axl_strcat -#define strncat axl_strncat -#define strcmp axl_strcmp -#define strncmp axl_strncmp -#define strchr axl_strchr -#define strstr axl_strstr -#endif - #endif // AXL_STRING diff --git a/main.c b/main.c index c9665f9..69c38b2 100644 --- a/main.c +++ b/main.c @@ -1,18 +1,17 @@ -#define AXL_MIMIC_STDLIB #include "axl.h" int _start(void) { axl_init(); - void* fds = malloc(83); + void* fds = axl_malloc(83); - int* f = malloc(sizeof(int)); + int* f = axl_malloc(sizeof(int)); *f = 4; *(int*)(fds) = 4; - (void)memcmp(f, fds, 4); - free(fds); - free(f); + (void)axl_memcmp(f, fds, 4); + axl_free(fds); + axl_free(f); (void)fds; (void)f;