# HG changeset patch # User Sean Halle # Date 1345931583 25200 # Node ID e7539330735af5d59cd09249e066d8153806f26f # Parent 88f71110f1a9a095fce55b6fcda73c86c9fbfcef# Parent 4ddb91bc7aa17981b8896e62f2e7c4be3817a5cb Merge -- "works, with test.." was mislabeled, really added DEBUG_printf3, and "move vms_defs" was adding valgrind to vmalloc diff -r 88f71110f1a9 -r e7539330735a Services_Offered_by_VMS/Memory_Handling/vmalloc.c --- a/Services_Offered_by_VMS/Memory_Handling/vmalloc.c Sat Aug 25 12:22:21 2012 -0700 +++ b/Services_Offered_by_VMS/Memory_Handling/vmalloc.c Sat Aug 25 14:53:03 2012 -0700 @@ -17,6 +17,8 @@ #include "VMS_impl/VMS.h" #include "Histogram/Histogram.h" +#include + #define MAX_UINT64 0xFFFFFFFFFFFFFFFF //A MallocProlog is a head element if the HigherInMem variable is NULL @@ -265,7 +267,8 @@ foundChunk = removeSmallChunk(freeLists, freeListIdx); //Mark as allocated - foundChunk->prevChunkInFreeList = NULL; + foundChunk->prevChunkInFreeList = NULL; + VALGRIND_MAKE_MEM_UNDEFINED(foundChunk + 1,sizeRequested); return foundChunk + 1; } @@ -284,6 +287,7 @@ MEAS__Capture_Post_Malloc_Point //skip over the prolog by adding its size to the pointer return + VALGRIND_MAKE_MEM_UNDEFINED(foundChunk + 1,sizeRequested); return foundChunk + 1; } @@ -331,6 +335,7 @@ } size_t chunkSize = getChunkSize(chunkToFree); + VALGRIND_MAKE_MEM_UNDEFINED(chunkToFree,chunkSize); if(chunkSize < BIG_LOWER_BOUND) { containerIdx = (chunkSize/SMALL_CHUNK_SIZE)-1; @@ -383,6 +388,7 @@ //Create first element in lastContainer MallocProlog *firstChunk = malloc( MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE ); if( firstChunk == NULL ) {printf("Can't allocate initial memory\n"); exit(1);} + VALGRIND_MAKE_MEM_NOACCESS(firstChunk,MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE); freeLists->memSpace = firstChunk; //Touch memory to avoid page faults diff -r 88f71110f1a9 -r e7539330735a Services_Offered_by_VMS/Memory_Handling/vmalloc.supp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Services_Offered_by_VMS/Memory_Handling/vmalloc.supp Sat Aug 25 14:53:03 2012 -0700 @@ -0,0 +1,29 @@ +{ + poolcreate + Memcheck:Addr1 + fun:VMS_ext__create_free_list +} + +{ + poolcreate + Memcheck:Addr4 + fun:VMS_ext__create_free_list +} +{ + poolcreate + Memcheck:Addr8 + fun:VMS_ext__create_free_list +} + +{ + vmsmalloc + Memcheck:Addr8 + ... + fun:VMS_int__malloc +} +{ + vmsmalloc + Memcheck:Addr4 + ... + fun:VMS_int__malloc +}