Skip to content

Commit

Permalink
test: ensure freeing closure
Browse files Browse the repository at this point in the history
GitHub: GH-102
  • Loading branch information
kou committed Sep 14, 2022
1 parent 0495624 commit b2fef17
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/fiddle/test_closure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,14 @@ def test_block_caller
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|
Expand Down

0 comments on commit b2fef17

Please sign in to comment.