Changeset 23305 for trunk/psLib
- Timestamp:
- Mar 12, 2009, 2:25:59 PM (17 years ago)
- Location:
- trunk/psLib/src/sys
- Files:
-
- 2 edited
-
psMemory.c (modified) (1 diff)
-
psMemory.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psMemory.c
r21346 r23305 1069 1069 memBlock->func, memBlock->file, memBlock->lineno, (unsigned long)memBlock->tid); 1070 1070 } 1071 1072 bool psMemTypeEqual (void *ptr1, void *ptr2) { 1073 1074 // if ptr is a psAlloc()'d memory, find the actual address of the memBlock 1075 psMemBlock *memBlock1 = ((psMemBlock *)ptr1) - 1; 1076 HANDLE_BAD_BLOCK(memBlock1, __FILE__, __LINE__, __func__); 1077 if (!memBlock1->freeFunc) return false; 1078 1079 // if ptr is a psAlloc()'d memory, find the actual address of the memBlock 1080 psMemBlock *memBlock2 = ((psMemBlock *)ptr2) - 1; 1081 HANDLE_BAD_BLOCK(memBlock2, __FILE__, __LINE__, __func__); 1082 if (!memBlock2->freeFunc) return false; 1083 1084 return (memBlock1->freeFunc == memBlock2->freeFunc); 1085 } -
trunk/psLib/src/sys/psMemory.h
r15047 r23305 636 636 ); 637 637 638 /** test for matching types (equal free functions) 639 * 640 * This function returns true if the two pointers have matching, non-NULL free functions. 641 * Supplied pointers must have been allocated within the psLib memory system (ie, with a psAlloc) or the function will abort. (XXX just return false?) 642 * Supplied pointers must have been provided with free function or the function returns false. 643 */ 644 bool psMemTypeEqual (void *ptr1, ///< pointer to first psMemory object 645 void *ptr2 ///< pointer to second psMemory object 646 ); 647 638 648 // Ensure this is a psLib pointer 639 649 #define PS_ASSERT_PTR_HEAVY(PTR, RVAL) \
Note:
See TracChangeset
for help on using the changeset viewer.
