IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14982


Ignore:
Timestamp:
Sep 21, 2007, 5:01:08 PM (19 years ago)
Author:
Paul Price
Message:

Memory assertion should be in the memory code, so that I can include psAssert.h without getting psMemory.h, which poisons malloc.

Location:
trunk/psLib/src/sys
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psAssert.h

    r14682 r14982  
    99#include <math.h>
    1010
    11 #include "psMemory.h"
    1211#include "psError.h"
    1312#include "psLogMsg.h"
     
    1817    psError(PS_ERR_PROGRAMMING, false, "Error: %s is not true.", #VAR); \
    1918    return(RVAL); \
    20 }
    21 
    22 // Ensure this is a psLib pointer
    23 #define PS_ASSERT_PTR(PTR, RVAL) \
    24 { \
    25     if (PTR && (!psMemIsAlloced(PTR))) { \
    26         psError(PS_ERR_MEMORY_CORRUPTION, false, \
    27             "Error: Pointer %p is corrupted or not on the PS memory system.", \
    28             PTR); \
    29         return RVAL; \
    30     } \
    3119}
    3220
  • trunk/psLib/src/sys/psMemory.h

    r14677 r14982  
    1515 *  @ingroup MemoryManagement
    1616 *
    17  *  @version $Revision: 1.71 $ $Name: not supported by cvs2svn $
    18  *  @date $Date: 2007-08-27 23:16:17 $
     17 *  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
     18 *  @date $Date: 2007-09-22 03:01:08 $
    1919 *
    2020 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    637637
    638638
     639// Ensure this is a psLib pointer
     640#define PS_ASSERT_PTR(PTR, RVAL) \
     641{ \
     642    if (PTR && (!psMemIsAlloced(PTR))) { \
     643        psError(PS_ERR_MEMORY_CORRUPTION, false, \
     644            "Error: Pointer %p is corrupted or not on the PS memory system.", \
     645            PTR); \
     646        return RVAL; \
     647    } \
     648}
     649
    639650/// @} end of SysUtils
    640651
Note: See TracChangeset for help on using the changeset viewer.