MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / inscribeInsanePointer

Function inscribeInsanePointer

src/misc/memory_model.cpp:28–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26 }
27
28 void inscribeInsanePointer ( void * ptr, void * who ) {
29 lock_guard<mutex> lock(g_insane_mutex);
30 if ( ptr == das_insane_pointer ) {
31 os_debug_break();
32 }
33 auto it = g_insane_pointers.find(ptr);
34 if ( it == g_insane_pointers.end() ) {
35 g_insane_pointers[ptr] = who;
36 } else {
37 DAS_FATAL_ERROR("insane pointer %p, already allocated by %p (and not by %p)", ptr, it->second, who);
38 }
39 }
40
41 void freeInsanePointer ( void * ptr ) {
42 lock_guard<mutex> lock(g_insane_mutex);

Callers

nothing calls this directly

Calls 3

os_debug_breakFunction · 0.85
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected