From cbd1b745863abefafd78b0e8db903f99099f017b Mon Sep 17 00:00:00 2001 From: kevin Date: Tue, 21 Jan 2014 22:34:46 -0500 Subject: [PATCH] cmMem.c : Added a comment at the location where breakpoints may be set to stop on the reallocation of a memory block with a known 'uniqueId'. --- cmMem.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/cmMem.c b/cmMem.c index 061e731..6c9e35e 100644 --- a/cmMem.c +++ b/cmMem.c @@ -518,8 +518,11 @@ void* cmMmAllocate( // p->nextId is incremented here cmThUIntIncr(&p->nextId,1); + /* - if( p->nextId == 2393 ) + // breakpoint for noticing allocation of memory blocks - see below for + // the location to notice reallocations of memory blocks + if( p->nextId == 7218 ) { cmErrMsg(&p->err,kOkMmRC,"Breakpoint for memory allocation id:%i.",p->nextId); } @@ -553,11 +556,23 @@ void* cmMmAllocate( } else // a reallocation occurred. + { if( orgDataPtr == ndp ) { if((rp = _cmMmFindRecd(p,orgDataPtr)) == NULL ) cmErrMsg(&p->err,kMissingRecdMmRC,"Unable to locate a tracking record associated with reallocation data area pointer:%p.",orgDataPtr); + else + { + /* + // break point for noticing reallocations on a memory block + if( rp->uniqueId == 7218 ) + { + cmErrMsg(&p->err,kOkMmRC,"Breakpoint for memory reallocation id:%i.",p->nextId); + } + */ + } } + } } return ndp;