decisions

This commit is contained in:
dcode
2019-03-15 09:26:31 +01:00
parent 139cec0846
commit 968b0321a0
20 changed files with 619 additions and 557 deletions

View File

@ -9,8 +9,8 @@ const TRACE = false;
@inline
export const HEADER_SIZE: usize = (offsetof<ManagedObject>() + AL_MASK) & ~AL_MASK;
import { ITERATEROOTS } from "../runtime";
import { AL_MASK, MAX_SIZE_32 } from "../util/allocator";
import { gc } from "../gc";
/** Collector states. */
const enum State {
@ -140,7 +140,7 @@ function step(): void {
}
case State.IDLE: {
if (TRACE) trace("gc~step/IDLE");
gc.iterateRoots(__gc_mark);
ITERATEROOTS(__gc_mark);
state = State.MARK;
if (TRACE) trace("gc~state = MARK");
break;
@ -161,7 +161,7 @@ function step(): void {
obj.hookFn(objToRef(obj));
} else {
if (TRACE) trace("gc~step/MARK finish");
gc.iterateRoots(__gc_mark);
ITERATEROOTS(__gc_mark);
obj = iter.next;
if (obj === toSpace) {
let from = fromSpace;