IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32722


Ignore:
Timestamp:
Nov 19, 2011, 1:12:52 AM (15 years ago)
Author:
eugene
Message:

stomp on memory before freeing (to poison accidental reuse)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psMemory.c

    r32716 r32722  
    12081208    #endif
    12091209
     1210# if (PS_TRACE_ON)   
     1211    // before freeing a particular block of memory, fill the entire block with FF to poison it
     1212    // this should trigger any bad reactions early.  this may be costly, so on do it for
     1213    // unoptimzed builds
     1214    size_t totalSize = sizeof(psMemBlock) + memBlock->userMemorySize + sizeof(void *);
     1215    memset ((void *) memBlock, 0xff, totalSize);
     1216# endif
     1217
    12101218    free(memBlock);
    12111219
Note: See TracChangeset for help on using the changeset viewer.