Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Truffle] We can call System.gc() in AOT.
Browse files Browse the repository at this point in the history
nirvdrum committed Jan 12, 2017
1 parent 36eb463 commit 3299e4f
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions truffle/src/main/ruby/core/gc.rb
Original file line number Diff line number Diff line change
@@ -37,19 +37,9 @@ def self.start
run(false)
end

if Truffle::Graal.substrate?

def self.run(force)
Truffle::Interop.execute(Truffle::Interop.read_property(Truffle::Java::System, :gc))
end

else

def self.run(force)
Truffle.primitive :vm_gc_start
raise PrimitiveFailure, "GC.run primitive failed"
end

def self.run(force)
Truffle.primitive :vm_gc_start
raise PrimitiveFailure, "GC.run primitive failed"
end

# Totally fake.

2 comments on commit 3299e4f

@eregon
Copy link
Member

@eregon eregon commented on 3299e4f Jan 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, we were going through Interop but only on substrate? That seems unexpected (the opposite would make more sense). cc @chrisseaton

@chrisseaton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that makes no sense.

Please sign in to comment.