update os layer

This commit is contained in:
Daniel Ledda
2025-01-02 11:02:27 +01:00
parent 5f0eaedfc6
commit 39ff16b6a6
7 changed files with 71 additions and 17 deletions

21
os_linux.cpp Normal file
View File

@@ -0,0 +1,21 @@
#ifndef OS_IMPL_LINUX_CPP
#define OS_IMPL_LINUX_CPP
#include <sys/mman.h>
#include <sys/stat.h>
#include "os.h"
void *os_alloc(size_t capacity) {
return mmap(0, capacity, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
}
void os_reserve(void *ptr) {
}
void os_decommit(void *ptr) {
}
void os_free(void *ptr) {
}
#endif