Changeset 10900
- Timestamp:
- Jan 4, 2007, 11:39:00 AM (19 years ago)
- Location:
- branches/jch-memory/psLib/src/sys
- Files:
-
- 2 edited
-
psMemory.c (modified) (4 diffs)
-
psMemory.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/jch-memory/psLib/src/sys/psMemory.c
r10899 r10900 9 9 * @author Joshua Hoblitt, University of Hawaii 10 10 * 11 * @version $Revision: 1.88.2.1 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2007-01-04 21: 09:32$11 * @version $Revision: 1.88.2.11 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2007-01-04 21:39:00 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 199 199 bool abort_on_error = false; 200 200 201 if (psMemCheckCorruption( abort_on_error) > 0) {202 fprintf(stderr, "Detected memory corruption\n"); // somewhere to set a breakpoint201 if (psMemCheckCorruption(stderr, abort_on_error) > 0) { 202 fprintf(stderr, "Detected memory corruption\n"); // somewhere to set a breakpoint 203 203 } 204 204 … … 322 322 } 323 323 324 int psMemCheckCorruption( bool abort_on_error)324 int psMemCheckCorruption(FILE *output, bool abort_on_error) 325 325 { 326 326 psS32 nbad = 0; // number of bad blocks … … 333 333 if (badMemBlock(memBlock)) { 334 334 nbad++; 335 336 fprintf(output, 337 "Memory corruption detected in memBlock %lu\n" 338 "\tSize %zd\n" 339 "\tPosts: %p %p %p\n" 340 "\tAllocated at %s (%s:%d) by thread %lu\n", 341 memBlock->id, 342 memBlock->userMemorySize, 343 memBlock->startblock, memBlock->endblock, (memBlock + 1 + memBlock->userMemorySize), 344 memBlock->func, memBlock->file, memBlock->lineno, memBlock->tid); 335 345 336 346 if (abort_on_error) { -
branches/jch-memory/psLib/src/sys/psMemory.h
r10899 r10900 12 12 * @ingroup MemoryManagement 13 13 * 14 * @version $Revision: 1.61.2. 3$ $Name: not supported by cvs2svn $15 * @date $Date: 2007-01-04 21: 09:32$14 * @version $Revision: 1.61.2.4 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2007-01-04 21:39:00 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 320 320 */ 321 321 int psMemCheckCorruption( 322 bool abort_on_error ///< Abort on detecting corruption? 322 FILE *output, ///< FILE to write corrupted blocks too 323 bool abort_on_error ///< Abort on detecting corruption? 323 324 ); 324 325
Note:
See TracChangeset
for help on using the changeset viewer.
