Class: MiniRacer::Isolate
- Inherits:
-
Object
- Object
- MiniRacer::Isolate
- Defined in:
- lib/mini_racer.rb,
lib/mini_racer/truffleruby.rb
Instance Method Summary collapse
- #idle_notification(idle_time) ⇒ Object
- #init_with_snapshot(snapshot) ⇒ Object
-
#initialize(snapshot = nil) ⇒ Isolate
constructor
A new instance of Isolate.
- #low_memory_notification ⇒ Object
Constructor Details
#initialize(snapshot = nil) ⇒ Isolate
Returns a new instance of Isolate.
84 85 86 87 88 89 90 91 |
# File 'lib/mini_racer.rb', line 84 def initialize(snapshot = nil) unless snapshot.nil? || snapshot.is_a?(Snapshot) raise ArgumentError, "snapshot must be a Snapshot object, passed a #{snapshot.inspect}" end # defined in the C class init_with_snapshot(snapshot) end |
Instance Method Details
#idle_notification(idle_time) ⇒ Object
328 329 330 |
# File 'lib/mini_racer/truffleruby.rb', line 328 def idle_notification(idle_time) true end |
#init_with_snapshot(snapshot) ⇒ Object
318 319 320 321 322 |
# File 'lib/mini_racer/truffleruby.rb', line 318 def init_with_snapshot(snapshot) # TruffleRuby does not have a 1-1 concept with isolate. # However, isolate can hold a snapshot, and code and ASTs are shared between contexts. @snapshot = snapshot end |
#low_memory_notification ⇒ Object
324 325 326 |
# File 'lib/mini_racer/truffleruby.rb', line 324 def low_memory_notification GC.start end |