IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 24, 2007, 12:14:48 PM (19 years ago)
Author:
jhoblitt
Message:

merge jch-memory branch - overhaul of memory subsystem

File:
1 edited

Legend:

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

    r10487 r11265  
    1313 *  @author Robert DeSonia, MHPCC
    1414 *
    15  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    16  *  @date $Date: 2006-12-06 03:01:42 $
     15 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     16 *  @date $Date: 2007-01-24 22:14:48 $
    1717 *
    1818 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    1919 */
     20
     21#ifdef HAVE_CONFIG_H
     22# include "config.h"
     23#endif
     24
    2025#include <stdio.h>
    2126#include <stdlib.h>
     
    2833#include "psError.h"
    2934#include "psConfigure.h"
    30 
    31 #include "config.h"
    3235
    3336static char *memCheckName = NULL;       // Filename to which to write results of mem check
     
    5861}
    5962
    60 // Print details of a memory problem to the appropriate file
    61 static void memoryProblem(const psMemBlock *ptr, // the pointer to the problematic memory block.
    62                           const char *file, // the file in which the problem originated
    63                           int lineno    // the line number in which the problem originated
    64                          )
    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 
    7463// Check the memory; intended for use on exit, but might be used elsewhere
    7564void p_psMemoryCheck(void)
     
    9382
    9483    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);
    9785    if (nCorrupted > 0) {
    9886        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.