From: Josef Weidendorfer Date: Fri, 22 Aug 2014 17:36:05 +0000 (+0000) Subject: Cleanup. Cost array was never called anyway. X-Git-Tag: svn/VALGRIND_3_10_0~152 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3675ccd650631829c972300a1f86b9eba18b16b8;p=thirdparty%2Fvalgrind.git Cleanup. Cost array was never called anyway. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14334 --- diff --git a/callgrind/costs.c b/callgrind/costs.c index 35c451f3e4..63256c71cd 100644 --- a/callgrind/costs.c +++ b/callgrind/costs.c @@ -46,6 +46,8 @@ ULong* CLG_(get_costarray)(Int size) CostChunk* cc = (CostChunk*) CLG_MALLOC("cl.costs.gc.1", sizeof(CostChunk) + COSTCHUNK_SIZE * sizeof(ULong)); + CLG_ASSERT(size < COSTCHUNK_SIZE); + cc->size = COSTCHUNK_SIZE; cc->used = 0; cc->next = 0; @@ -66,15 +68,3 @@ ULong* CLG_(get_costarray)(Int size) return ptr; } - -void CLG_(free_costarrays)() -{ - CostChunk* cc = cost_chunk_base, *cc_next; - while(cc) { - cc_next = cc->next; - VG_(free)(cc); - cc = cc_next; - } - cost_chunk_base = 0; - cost_chunk_current = 0; -} diff --git a/callgrind/costs.h b/callgrind/costs.h index 3fdc62947b..8335f0da2b 100644 --- a/callgrind/costs.h +++ b/callgrind/costs.h @@ -40,7 +40,7 @@ extern UInt CLG_(costarray_chunks); /* Array of 64bit costs. This is separated from other structs * to support a dynamic number of costs for a cost item. - * Chunks are allocated on demand, and deallocated at program termination. + * Chunks are allocated on demand. */ typedef struct _CostChunk CostChunk; struct _CostChunk { @@ -53,7 +53,5 @@ struct _CostChunk { /* Allocate a number of 64bit cost values. * Typically used from ct_events.c */ ULong* CLG_(get_costarray)(Int size); -void CLG_(free_costarrays)(void); - #endif /* CLG_COSTS */