diff --git a/vm/gc.cpp b/vm/gc.cpp index b1cdaa52af..5ea23dce3b 100755 --- a/vm/gc.cpp +++ b/vm/gc.cpp @@ -155,6 +155,7 @@ void factor_vm::gc(gc_op op, cell requested_size, bool trace_contexts_p) assert(!data->high_fragmentation_p()); current_gc = new gc_state(op,this); + atomic::store(¤t_gc_p, true); /* Keep trying to GC higher and higher generations until we don't run out of space in the target generation. */ @@ -217,6 +218,7 @@ void factor_vm::gc(gc_op op, cell requested_size, bool trace_contexts_p) end_gc(); + atomic::store(¤t_gc_p, false); delete current_gc; current_gc = NULL; diff --git a/vm/vm.cpp b/vm/vm.cpp index d7cdf99e85..ecc3359e0c 100755 --- a/vm/vm.cpp +++ b/vm/vm.cpp @@ -12,6 +12,8 @@ factor_vm::factor_vm() : safepoint_fep_p(false), gc_off(false), current_gc(NULL), + current_gc_p(false), + current_jit_p(false), gc_events(NULL), fep_p(false), fep_help_was_shown(false), diff --git a/vm/vm.hpp b/vm/vm.hpp index b58cdcb99a..b62ac3f9c9 100755 --- a/vm/vm.hpp +++ b/vm/vm.hpp @@ -91,7 +91,11 @@ struct factor_vm callback_heap *callbacks; /* Only set if we're performing a GC */ - volatile gc_state *current_gc; + gc_state *current_gc; + volatile cell current_gc_p; + + /* Set if we're in the jit */ + volatile cell current_jit_p; /* Mark stack */ std::vector mark_stack;