e08c4c635e

Co-authored-by: Sutou Kouhei <kou@clear-code.com>
This commit is contained in:
Hiroshi SHIBATA 2021-09-05 04:54:25 +09:00 committed by Nobuyoshi Nakada
parent afa33da72b
commit 8f752c95d2
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
Notes: git 2021-09-05 19:26:21 +09:00
8 changed files with 79 additions and 37 deletions

View file

@ -185,7 +185,16 @@ module Fiddle
end if /freebsd/=~ RUBY_PLATFORM
def test_no_memory_leak
assert_no_memory_leak(%w[-W0 -rfiddle.so], '', '100_000.times {Fiddle::Handle.allocate}; GC.start', rss: true)
if respond_to?(:assert_nothing_leaked_memory)
n_tries = 100_000
assert_nothing_leaked_memory(SIZEOF_VOIDP * (n_tries / 100)) do
n_tries.times do
Fiddle::Handle.allocate
end
end
else
assert_no_memory_leak(%w[-W0 -rfiddle.so], '', '100_000.times {Fiddle::Handle.allocate}; GC.start', rss: true)
end
end
if /cygwin|mingw|mswin/ =~ RUBY_PLATFORM