Explorar o código

Fixed the parameters to mmap in malloc.
malloc now works, but wastes alot of memory with the minimum
amount of memory used for each allocation being 4k.

Ron Alder %!s(int64=26) %!d(string=hai) anos
pai
achega
bc5ac6bc3d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      libc/stdlib/malloc/alloc.c

+ 1 - 1
libc/stdlib/malloc/alloc.c

@@ -62,7 +62,7 @@ void *
 malloc(size_t len)
 {
   void * result = mmap((void *)0, len, PROT_READ | PROT_WRITE,
-                 MAP_SHARED | MAP_ANONYMOUS, 0, 0);
+                 MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
   if (result == (void*)-1)
     return 0;