1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00
therubyracer/specmem/spec_helper.rb

24 lines
No EOL
442 B
Ruby

require Pathname(__FILE__).dirname.join('../spec/spec_helper')
module V8::MemSpec
def self.included(cls)
cls.class_eval do
include V8::ExtSpec
before(:all) {V8::C::V8::SetFlagsFromString("--expose-gc")}
end
end
def ruby_gc
current = GC.stress
GC.stress = true
yield
ensure
GC.stress = current
end
def v8_gc
while !c::V8::IdleNotification();end
v8_eval('gc()', 'gc.js')
end
end