| 39 | } |
| 40 | |
| 41 | void freeInsanePointer ( void * ptr ) { |
| 42 | lock_guard<mutex> lock(g_insane_mutex); |
| 43 | auto it = g_insane_pointers.find(ptr); |
| 44 | if ( it != g_insane_pointers.end() ) { |
| 45 | g_insane_pointers.erase(it); |
| 46 | } else { |
| 47 | DAS_FATAL_ERROR("freeing insane pointer %p, which was not allocated", ptr); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | #define INSCRIBE_INSANE_POINTER(ptr,model) inscribeInsanePointer(ptr,model) |
| 52 | #define FREE_INSANE_POINTER(ptr) freeInsanePointer(ptr) |