Changeset 11265 for trunk/psLib/src/sys/psConfigure.c
- Timestamp:
- Jan 24, 2007, 12:14:48 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psConfigure.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psConfigure.c
r10487 r11265 13 13 * @author Robert DeSonia, MHPCC 14 14 * 15 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $16 * @date $Date: 200 6-12-06 03:01:42$15 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2007-01-24 22:14:48 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 19 19 */ 20 21 #ifdef HAVE_CONFIG_H 22 # include "config.h" 23 #endif 24 20 25 #include <stdio.h> 21 26 #include <stdlib.h> … … 28 33 #include "psError.h" 29 34 #include "psConfigure.h" 30 31 #include "config.h"32 35 33 36 static char *memCheckName = NULL; // Filename to which to write results of mem check … … 58 61 } 59 62 60 // Print details of a memory problem to the appropriate file61 static void memoryProblem(const psMemBlock *ptr, // the pointer to the problematic memory block.62 const char *file, // the file in which the problem originated63 int lineno // the line number in which the problem originated64 )65 {66 fprintf(memCheckFile,67 "Memory corruption detected in memBlock %lu\n"68 "\tFile %s, line %d, size %zd\n"69 "\tPosts: %p %p %p\n",70 ptr->id, file, lineno, ptr->userMemorySize, ptr->startblock, ptr->endblock,71 (ptr + 1 + ptr->userMemorySize));72 }73 74 63 // Check the memory; intended for use on exit, but might be used elsewhere 75 64 void p_psMemoryCheck(void) … … 93 82 94 83 int nCorrupted; // Number of corrupted memory blocks 95 (void)psMemProblemCallbackSet((psMemProblemCallback)memoryProblem); // Set callback for corruption 96 nCorrupted = psMemCheckCorruption(false); 84 nCorrupted = psMemCheckCorruption(memCheckFile, false); 97 85 if (nCorrupted > 0) { 98 86 psError(PS_ERR_UNKNOWN, true, "%d memory blocks corrupted; list written to %s.\n", nCorrupted, memCheckName);
Note:
See TracChangeset
for help on using the changeset viewer.
