Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
comparison vmalloc.c @ 86:ef4cb0ded940
Added tag V0 for changeset fcb988543be0
| author | Merten Sach <msach@mailbox.tu-berlin.de> |
|---|---|
| date | Wed, 13 Jul 2011 18:07:52 +0200 |
| parents | 521c75d64cef |
| children | a214c84dff4e |
comparison
equal
deleted
inserted
replaced
| 9:56c0a8ace56a | 10:9a32e19e74f3 |
|---|---|
| 448 // mem and all frees of it must be done in this thread, with the | 448 // mem and all frees of it must be done in this thread, with the |
| 449 // thread's original stack available | 449 // thread's original stack available |
| 450 freeListHead = malloc( sizeof(MallocProlog) ); | 450 freeListHead = malloc( sizeof(MallocProlog) ); |
| 451 firstChunk = malloc( MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE ); | 451 firstChunk = malloc( MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE ); |
| 452 if( firstChunk == NULL ) {printf("malloc error\n"); exit(1);} | 452 if( firstChunk == NULL ) {printf("malloc error\n"); exit(1);} |
| 453 | |
| 454 //Touch memory to avoid page faults | |
| 455 //void *ptr,*endPtr; | |
| 456 //endPtr = (void*)firstChunk+MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE; | |
| 457 //for(ptr = firstChunk; ptr < endPtr; ptr+=PAGE_SIZE) | |
| 458 //{ | |
| 459 // *(char*)ptr = 0; | |
| 460 //} | |
| 453 | 461 |
| 454 freeListHead->prevChunkInFreeList = NULL; | 462 freeListHead->prevChunkInFreeList = NULL; |
| 455 //Use this addr to free the heap when cleanup | 463 //Use this addr to free the heap when cleanup |
| 456 freeListHead->nextLowerInMem = firstChunk; | 464 freeListHead->nextLowerInMem = firstChunk; |
| 457 //to identify top-of-heap elem, compare this addr to elem's next higher | 465 //to identify top-of-heap elem, compare this addr to elem's next higher |
