Sigma sysdeps: Get rid of valloc and switch to mmap
@@ -12,11 +12,12 @@ namespace mlibc
{
int sys_anon_allocate(size_t size, void **pointer){
__ensure((size & 0xFFF) == 0);
- uint64_t ret = libsigma_valloc(LIBSIGMA_VALLOC_TYPE_SBRK_LIKE, 0, size / 0x1000);
- if(ret == 1)
+
+ void* ret = libsigma_vm_map(size, NULL, NULL, PROT_READ | PROT_WRITE, MAP_ANONYMOUS);
+ if(!ret)
return ENOMEM;
- *pointer = (void*)ret;
+ *pointer = ret;
return 0;
}
int sys_anon_free(void *pointer, size_t size){
