started implementing the garbage collector
This commit is contained in:
@@ -31,6 +31,18 @@ var Struct = {
|
||||
var target = yield* this.getOperation(op.target)
|
||||
if (!target.deleted) {
|
||||
target.deleted = true
|
||||
if (target.left !== null && (yield* this.getOperation(target.left)).deleted) {
|
||||
this.store.addToGarbageCollector(target.id)
|
||||
target.gc = true
|
||||
}
|
||||
if (target.right !== null) {
|
||||
var right = yield* this.getOperation(target.right)
|
||||
if (right.deleted && right.gc == null) {
|
||||
this.store.addToGarbageCollector(right.id)
|
||||
right.gc = true
|
||||
yield* this.setOperation(right)
|
||||
}
|
||||
}
|
||||
yield* this.setOperation(target)
|
||||
this.ds.delete(target.id)
|
||||
var t = this.store.initializedTypes[JSON.stringify(target.parent)]
|
||||
|
||||
Reference in New Issue
Block a user