mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/fiddle] test: ensure freeing closure
GitHub: GH-102 https://github.com/ruby/fiddle/commit/b2fef1770d
This commit is contained in:
parent
824c474c95
commit
9f62768e51
1 changed files with 6 additions and 3 deletions
|
@ -102,11 +102,14 @@ module Fiddle
|
|||
end
|
||||
end
|
||||
|
||||
def test_memsize
|
||||
def test_memsize_ruby_dev_42480
|
||||
require 'objspace'
|
||||
bug = '[ruby-dev:42480]'
|
||||
n = 10000
|
||||
assert_equal(n, n.times {ObjectSpace.memsize_of(Closure.allocate)}, bug)
|
||||
n.times do
|
||||
Closure.create(:int, [:void]) do |closure|
|
||||
ObjectSpace.memsize_of(closure)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
%w[INT SHORT CHAR LONG LONG_LONG].each do |name|
|
||||
|
|
Loading…
Add table
Reference in a new issue