Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
changeset 250:7a2039d9fa7d Common_Ancestor
move vms_defs
| author | Nina Engelhardt <nengel@mailbox.tu-berlin.de> |
|---|---|
| date | Tue, 21 Aug 2012 17:44:51 +0200 |
| parents | 88fd330feef3 |
| children | 4ddb91bc7aa1 |
| files | Services_Offered_by_VMS/Memory_Handling/vmalloc.c |
| diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line diff
1.1 --- a/Services_Offered_by_VMS/Memory_Handling/vmalloc.c Fri Aug 17 17:15:45 2012 -0700 1.2 +++ b/Services_Offered_by_VMS/Memory_Handling/vmalloc.c Tue Aug 21 17:44:51 2012 +0200 1.3 @@ -17,6 +17,8 @@ 1.4 #include "VMS_impl/VMS.h" 1.5 #include "Histogram/Histogram.h" 1.6 1.7 +#include <valgrind/memcheck.h> 1.8 + 1.9 #define MAX_UINT64 0xFFFFFFFFFFFFFFFF 1.10 1.11 //A MallocProlog is a head element if the HigherInMem variable is NULL 1.12 @@ -265,7 +267,8 @@ 1.13 foundChunk = removeSmallChunk(freeLists, freeListIdx); 1.14 1.15 //Mark as allocated 1.16 - foundChunk->prevChunkInFreeList = NULL; 1.17 + foundChunk->prevChunkInFreeList = NULL; 1.18 + VALGRIND_MAKE_MEM_UNDEFINED(foundChunk + 1,sizeRequested); 1.19 return foundChunk + 1; 1.20 } 1.21 1.22 @@ -284,6 +287,7 @@ 1.23 MEAS__Capture_Post_Malloc_Point 1.24 1.25 //skip over the prolog by adding its size to the pointer return 1.26 + VALGRIND_MAKE_MEM_UNDEFINED(foundChunk + 1,sizeRequested); 1.27 return foundChunk + 1; 1.28 } 1.29 1.30 @@ -331,6 +335,7 @@ 1.31 } 1.32 1.33 size_t chunkSize = getChunkSize(chunkToFree); 1.34 + VALGRIND_MAKE_MEM_UNDEFINED(chunkToFree,chunkSize); 1.35 if(chunkSize < BIG_LOWER_BOUND) 1.36 { 1.37 containerIdx = (chunkSize/SMALL_CHUNK_SIZE)-1; 1.38 @@ -383,6 +388,7 @@ 1.39 //Create first element in lastContainer 1.40 MallocProlog *firstChunk = malloc( MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE ); 1.41 if( firstChunk == NULL ) {printf("Can't allocate initial memory\n"); exit(1);} 1.42 + VALGRIND_MAKE_MEM_NOACCESS(firstChunk,MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE); 1.43 freeLists->memSpace = firstChunk; 1.44 1.45 //Touch memory to avoid page faults
