Restructure the library layers

This commit is contained in:
2025-12-16 17:36:50 +00:00
parent c0d901d7e9
commit 4b95a681d4
55 changed files with 161 additions and 161 deletions

30
src/os/mem/mem_os.c Normal file
View File

@@ -0,0 +1,30 @@
// vim:fileencoding=utf-8:foldmethod=marker
#include "mem_os.h"
#include "mem_os_ops.h"
#include "../../common/aliases/aliases.h"
#include "../../common/platform/platform.h"
#include <assert.h>
#include <string.h>
#if defined(WAPP_PLATFORM_WINDOWS)
#include "win/mem_os_win.h"
#elif defined(WAPP_PLATFORM_POSIX)
#include "posix/mem_os_posix.h"
#else
#error "Unrecognised platform"
#endif
void *wapp_mem_util_alloc(void *addr, u64 size, MemAccess access, MemAllocFlags flags, MemInitType type) {
void *output = mem_util_allocate(addr, size, access, flags, type);
if (type == WAPP_MEM_INIT_INITIALISED) {
memset(output, 0, size);
}
return output;
}
void wapp_mem_util_free(void *ptr, u64 size) {
mem_util_free(ptr, size);
}