Changeset 32746 for trunk/psLib
- Timestamp:
- Nov 22, 2011, 10:17:57 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psMemory.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psMemory.c
r32722 r32746 100 100 PS_MEM_ABORT(__func__, "Unsafe to Continue\n"); \ 101 101 } 102 103 static bool checkingForCorruption = false; 102 104 103 105 static bool isBadMemBlock(FILE *output, const psMemBlock *memBlock, const char *file, unsigned int lineo, const char *func); … … 746 748 } 747 749 fprintf(output, _("\n\tMemory block is corrupted; buffer underflow detected.\n")); 750 if (!checkingForCorruption) { 751 p_psMemCheckCorruption(__FILE__, __LINE__, __func__, output, false); 752 } 748 753 bad = true; 749 754 } … … 755 760 } 756 761 fprintf(output, _("\n\tMemory block is corrupted; buffer overflow detected.\n")); 762 if (!checkingForCorruption) { 763 p_psMemCheckCorruption(__FILE__, __LINE__, __func__, output, false); 764 } 757 765 bad = true; 758 766 } … … 1304 1312 MUTEX_LOCK(&memBlockListMutex); 1305 1313 1314 // this function calls 'isBadMemBlock', which may in turn call this function : avoid nested calls or we will be stuck forever 1315 checkingForCorruption = true; 1316 1306 1317 psS32 nbad = 0; // number of bad blocks 1307 1318 for (psMemBlock *memBlock = (psMemBlock *) lastMemBlockAllocated; memBlock != NULL; memBlock = memBlock->nextBlock) { … … 1316 1327 } 1317 1328 } 1329 1330 checkingForCorruption = true; 1318 1331 1319 1332 // release the lock on the memblock list
Note:
See TracChangeset
for help on using the changeset viewer.
