Luna/libs/libc/src/bits/bindings.c

24 lines
388 B
C
Raw Normal View History

#include <stddef.h>
#include <sys/mman.h>
int liballoc_lock()
{
return 0;
}
int liballoc_unlock()
{
return 0;
}
void* liballoc_alloc(size_t size)
{
2022-10-08 12:44:48 +00:00
void* result = mmap(NULL, size * 4096, PROT_READ_WRITE, 0, 0, 0);
if (result == MAP_FAILED) return 0;
return (void*)result;
}
int liballoc_free(void* address, size_t size)
{
return munmap(address, size * 4096);
}