]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/gc.cpp
VM: fix one callstack overflow problem by "unlocking" the callstacks
[factor.git] / vm / gc.cpp
index 91be631d9098bb95dccb2e69cfc2ea3189a084b9..f3c5ff43fc03f8c8b74502754150ed3357cf1256 100644 (file)
--- a/vm/gc.cpp
+++ b/vm/gc.cpp
@@ -122,6 +122,8 @@ void factor_vm::gc(gc_op op, cell requested_size) {
   FACTOR_ASSERT(!data->high_fragmentation_p());
 
   current_gc = new gc_state(op, this);
+  if (ctx)
+    ctx->callstack_seg->set_border_locked(false);
   atomic::store(&current_gc_p, true);
 
   /* Keep trying to GC higher and higher generations until we don't run
@@ -179,6 +181,8 @@ void factor_vm::gc(gc_op op, cell requested_size) {
   end_gc();
 
   atomic::store(&current_gc_p, false);
+  if (ctx)
+    ctx->callstack_seg->set_border_locked(true);
   delete current_gc;
   current_gc = NULL;