From e97bc661483173c23f26880ffef50d02955e73da Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 28 Apr 2026 17:32:18 +0300 Subject: feat: Implement hash table --- MemoryManager.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'MemoryManager.c') diff --git a/MemoryManager.c b/MemoryManager.c index 98e70e7..53f906e 100644 --- a/MemoryManager.c +++ b/MemoryManager.c @@ -1,6 +1,7 @@ #include "MemoryManager.h" #include "Types.h" #include +#include Result std_alloc(MemoryManager mm, void **ptr, usize size) { @@ -44,3 +45,19 @@ M_std() { .destroy = &std_destroy, }; } + +char* +M_strdup(MemoryManager mm, const char* str) { + if (NULL == str) + return NULL; + + char* newstr = NULL; + if (R_Ok != mm.alloc(mm, (void**)&newstr, strlen(str) + 1) || + NULL == newstr) + { + return NULL; + } + + strcpy(newstr, str); + return newstr; +} -- cgit v1.2.3