Skip to content

Commit

Permalink
Showing 2 changed files with 2 additions and 22 deletions.
12 changes: 1 addition & 11 deletions core/src/main/java/org/jruby/truffle/nodes/core/GCNodes.java
Original file line number Diff line number Diff line change
@@ -27,23 +27,13 @@
public abstract class GCNodes {

@CoreMethod(names = "start", onSingleton = true, maxArgs = 0)
public abstract static class StartNode extends CoreMethodNode {

@Child protected GarbageCollectNode gcNode;

public abstract static class StartNode extends GarbageCollectNode {
public StartNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
gcNode = GCNodesFactory.GarbageCollectNodeFactory.create(context, sourceSection, null);
}

public StartNode(StartNode prev) {
super(prev);
this.gcNode = prev.gcNode;
}

@Specialization
public NilPlaceholder start() {
return gcNode.executeGC();
}
}

Original file line number Diff line number Diff line change
@@ -116,23 +116,13 @@ public RubyProc defineFinalizer(Object object, RubyProc finalizer) {
}

@CoreMethod(names = "garbage_collect", isModuleFunction = true, maxArgs = 0)
public abstract static class GarbageCollectNode extends CoreMethodNode {

@Child protected GCNodes.GarbageCollectNode gcNode;

public abstract static class GarbageCollectNode extends GCNodes.GarbageCollectNode {
public GarbageCollectNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
gcNode = GCNodesFactory.GarbageCollectNodeFactory.create(context, sourceSection, null);
}

public GarbageCollectNode(GarbageCollectNode prev) {
super(prev);
this.gcNode = prev.gcNode;
}

@Specialization
public NilPlaceholder garbageCollect() {
return gcNode.executeGC();
}
}

0 comments on commit 754bf41

Please sign in to comment.