Changeset 10900 for branches/jch-memory/psLib/src/sys/psMemory.c
- Timestamp:
- Jan 4, 2007, 11:39:00 AM (19 years ago)
- File:
-
- 1 edited
-
branches/jch-memory/psLib/src/sys/psMemory.c (modified) (4 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) {
Note:
See TracChangeset
for help on using the changeset viewer.
