| 793 | /// @note This function does not allow interior pointers! |
| 794 | |
| 795 | void checkPtr( void* ptr ) |
| 796 | { |
| 797 | for( HeapIterator iter; iter.isValid(); ++ iter ) |
| 798 | { |
| 799 | AllocatedHeader* header = ( AllocatedHeader* ) *iter; |
| 800 | if( header->getUserPtr() == ptr ) |
| 801 | { |
| 802 | #ifdef TORQUE_DEBUG_GUARD |
| 803 | char buffer[ 1024 ]; |
| 804 | if( !checkGuard( *iter, true ) ) |
| 805 | { |
| 806 | dSprintf( buffer, sizeof( buffer ), "0x%x is a valid heap pointer but has its guards corrupted", ptr ); |
| 807 | Platform::outputDebugString( buffer ); |
| 808 | return; |
| 809 | } |
| 810 | //dSprintf( buffer, sizeof( buffer ), "0x%x is a valid heap pointer", ptr ); |
| 811 | //Platform::outputDebugString( buffer ); |
| 812 | #endif |
| 813 | return; |
| 814 | } |
| 815 | } |
| 816 | |
| 817 | char buffer[ 1024 ]; |
| 818 | dSprintf( buffer, sizeof( buffer ), "0x%x is not a valid heap pointer", ptr ); |
| 819 | Platform::outputDebugString( buffer ); |
| 820 | |
| 821 | Platform::debugBreak(); |
| 822 | } |
| 823 | |
| 824 | /// Dump info on all memory blocks that are still allocated. |
| 825 | /// @note Only works if TORQUE_DISABLE_MEMORY_MANAGER is not defined; otherwise this is a NOP. |
no test coverage detected