Changeset 1696 for trunk/psLib/src/sys/psMemory.c
- Timestamp:
- Sep 7, 2004, 9:05:07 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psMemory.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psMemory.c
r1440 r1696 9 9 * @author Robert Lupton, Princeton University 10 10 * 11 * @version $Revision: 1.3 4$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-0 8-09 23:34:58$11 * @version $Revision: 1.35 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-09-07 19:05:07 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 27 27 #include "psLogMsg.h" 28 28 29 #include "psSysUtilsErrors.h" 30 #define ERRORNAME_PREFIX PS_ERRORNAME_DOMAIN ".psMemory." 31 29 32 #define P_PS_MEMMAGIC (void *)0xdeadbeef // Magic number in psMemBlock header 30 33 … … 100 103 { 101 104 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); 105 108 } 106 109 … … 228 231 229 232 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); 231 235 return 1; 232 236 } … … 234 238 if (m->refCounter == 0) { 235 239 // 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); 237 243 return 1; 238 244 } 239 245 240 246 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); 242 250 return 1; 243 251 } 244 252 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); 246 256 return 1; 247 257 }
Note:
See TracChangeset
for help on using the changeset viewer.
