diff vmalloc.c @ 148:eb79d057d10d

merged dangling head
author Merten Sach <msach@mailbox.tu-berlin.de>
date Tue, 27 Sep 2011 14:42:26 +0200
parents a214c84dff4e
children ca154ebe2b6c dbfc8382d546 c1784868dcea
line diff
     1.1 --- a/vmalloc.c	Wed Sep 21 16:31:19 2011 +0200
     1.2 +++ b/vmalloc.c	Tue Sep 27 14:42:26 2011 +0200
     1.3 @@ -452,12 +452,12 @@
     1.4     if( firstChunk == NULL ) {printf("malloc error\n"); exit(1);}
     1.5     
     1.6     //Touch memory to avoid page faults
     1.7 -   //void *ptr,*endPtr; 
     1.8 -   //endPtr = (void*)firstChunk+MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE;
     1.9 -   //for(ptr = firstChunk; ptr < endPtr; ptr+=PAGE_SIZE)
    1.10 -   //{
    1.11 -   //    *(char*)ptr = 0;
    1.12 -   //}
    1.13 +   void *ptr,*endPtr; 
    1.14 +   endPtr = (void*)firstChunk+MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE;
    1.15 +   for(ptr = firstChunk; ptr < endPtr; ptr+=PAGE_SIZE)
    1.16 +   {
    1.17 +       *(char*)ptr = 0;
    1.18 +   }
    1.19  
    1.20     freeListHead->prevChunkInFreeList = NULL;
    1.21        //Use this addr to free the heap when cleanup