Răsfoiți Sursa

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 26 ani în urmă
părinte
comite
bc5ac6bc3d
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  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;