VM: don't end the gc event in start_gc_again, fixes #659

locals-and-roots
Björn Lindqvist 2016-05-04 22:47:50 +02:00
parent 583fb5825b
commit 8911ad2a16
2 changed files with 8 additions and 6 deletions

View File

@ -1,4 +1,5 @@
USING: tools.test tools.memory memory arrays ; USING: arrays math memory namespaces parser sequences tools.memory
tools.memory.private tools.test tools.time ;
IN: tools.memory.tests IN: tools.memory.tests
{ } [ room. ] unit-test { } [ room. ] unit-test
@ -8,3 +9,9 @@ IN: tools.memory.tests
{ } [ gc-stats. ] unit-test { } [ gc-stats. ] unit-test
{ } [ gc-summary. ] unit-test { } [ gc-summary. ] unit-test
{ } [ callback-room. ] unit-test { } [ callback-room. ] unit-test
! Each gc-event must reclaim something. #659
{ f } [
[ "resource:basis/tools/memory/memory.factor" run-file ] time
gc-events get [ space-reclaimed 0 < ] any?
] unit-test

View File

@ -72,8 +72,6 @@ void factor_vm::end_gc() {
} }
void factor_vm::start_gc_again() { void factor_vm::start_gc_again() {
end_gc();
switch (current_gc->op) { switch (current_gc->op) {
case collect_nursery_op: case collect_nursery_op:
/* Nursery collection can fail if aging does not have enough /* Nursery collection can fail if aging does not have enough
@ -92,9 +90,6 @@ void factor_vm::start_gc_again() {
critical_error("in start_gc_again, bad GC op", current_gc->op); critical_error("in start_gc_again, bad GC op", current_gc->op);
break; break;
} }
if (gc_events)
current_gc->event = new gc_event(current_gc->op, this);
} }
void factor_vm::set_current_gc_op(gc_op op) { void factor_vm::set_current_gc_op(gc_op op) {