IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 7, 2004, 9:05:07 AM (22 years ago)
Author:
desonia
Message:

added error stack to sysUtils

File:
1 edited

Legend:

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

    r1440 r1696  
    99*  @author Robert Lupton, Princeton University
    1010*
    11 *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2004-08-09 23:34:58 $
     11*  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2004-09-07 19:05:07 $
    1313*
    1414*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2727#include "psLogMsg.h"
    2828
     29#include "psSysUtilsErrors.h"
     30#define ERRORNAME_PREFIX PS_ERRORNAME_DOMAIN ".psMemory."
     31
    2932#define P_PS_MEMMAGIC (void *)0xdeadbeef   // Magic number in psMemBlock header
    3033
     
    100103{
    101104    if (ptr->refCounter < 1) {
    102         psError(__func__,
    103                 "Block %ld allocated at %s:%d freed more than once at %s:%d\n",
    104                 ptr->id, ptr->file, ptr->lineno, file, lineno);
     105        psErrorMsg(ERRORNAME_PREFIX "memProblemCallbackDefault", false, PS_ERR_MEMORY_CORRUPTION,
     106                   PS_ERRORTEXT_memProblemCallbackDefault_MULTIPLE_FREE,
     107                   ptr->id, ptr->file, ptr->lineno, file, lineno);
    105108    }
    106109
     
    228231
    229232    if (m == NULL) {
    230         psError(funcName, "Memory Corruption: NULL memory block found.");
     233        psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION,
     234                   PS_ERRORTEXT_checkMemBlock_NULL_BLOCK);
    231235        return 1;
    232236    }
     
    234238    if (m->refCounter == 0) {
    235239        // using an unreferenced block of memory, are you?
    236         psError(__func__, "Memory Corruption: memory block %ld was freed but still used.", m->id);
     240        psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION,
     241                   PS_ERRORTEXT_checkMemBlock_DEREF_USE,
     242                   m->id);
    237243        return 1;
    238244    }
    239245
    240246    if (m->startblock != P_PS_MEMMAGIC || m->endblock != P_PS_MEMMAGIC) {
    241         psError(funcName, "Memory Corruption: memory block %ld is corrupted (buffer underflow)", m->id);
     247        psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION,
     248                   PS_ERRORTEXT_checkMemBlock_UNDERFLOW,
     249                   m->id);
    242250        return 1;
    243251    }
    244252    if (*(void **)((int8_t *) (m + 1) + m->userMemorySize) != P_PS_MEMMAGIC) {
    245         psError(funcName, "Memory Corruption: memory block %ld is corrupted (buffer overflow)", m->id);
     253        psErrorMsg(ERRORNAME_PREFIX "checkMemBlock", true, PS_ERR_MEMORY_CORRUPTION,
     254                   PS_ERRORTEXT_checkMemBlock_OVERFLOW,
     255                   m->id);
    246256        return 1;
    247257    }
Note: See TracChangeset for help on using the changeset viewer.