Changeset fb97252f
- Timestamp:
- Apr 17, 2018, 2:10:11 PM (7 years ago)
- Branches:
- new-env, with_gc
- Children:
- 5af7306
- Parents:
- 24de7b1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/GC.cc
r24de7b1 rfb97252f 51 51 } 52 52 53 // build with flag GC_TRAP to compile in a breakpoint on register and sweep of a dynamically 54 // chosen object. Process to use: 55 // break GC::register_object 56 // run 57 // set variable GC_TRAP_OBJ = <target> 58 // disable <first breakpoint> 59 #ifdef GC_TRAP 60 #include <csignal> 61 62 /// Set to object to check in debugger 63 void* GC_TRAP_OBJ = nullptr; 64 #endif 65 53 66 void GC::register_object(GC_Object* obj) { 67 #ifdef GC_TRAP 68 if ( obj == GC_TRAP_OBJ ) std::raise(SIGTRAP); 69 #endif 54 70 gens[g].push_back(obj); 55 71 obj->mark = !this->mark; // initialize as un-marked … … 81 97 for ( GC_Object*& obj : young ) { 82 98 if ( obj->mark != mark ) { 99 #ifdef GC_TRAP 100 if ( obj == GC_TRAP_OBJ ) std::raise(SIGTRAP); 101 #endif 83 102 delete obj; 84 103 obj = nullptr; … … 103 122 for ( GC_Object*& obj : old ) { 104 123 if ( obj->mark != mark ) { 124 #ifdef GC_TRAP 125 if ( obj == GC_TRAP_OBJ ) std::raise(SIGTRAP); 126 #endif 105 127 delete obj; 106 128 obj = nullptr;
Note: See TracChangeset
for help on using the changeset viewer.