diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index b0ac1e6536..2180c31d57 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -564,6 +564,16 @@ class TestSetTraceFunc < Test::Unit::TestCase } end + # Bug #18264 + def test_tracpoint_memory_leak + assert_no_memory_leak([], <<-PREP, <<-CODE, rss: true) +code = proc { TracePoint.new(:line) { } } +1_000.times(&code) +PREP +1_000_000.times(&code) +CODE + end + def trace_by_set_trace_func events = [] trace = nil diff --git a/version.h b/version.h index d909e5763c..1bbf7eb455 100644 --- a/version.h +++ b/version.h @@ -12,11 +12,11 @@ # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR #define RUBY_VERSION_TEENY 3 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 148 +#define RUBY_PATCHLEVEL 149 #define RUBY_RELEASE_YEAR 2021 -#define RUBY_RELEASE_MONTH 10 -#define RUBY_RELEASE_DAY 31 +#define RUBY_RELEASE_MONTH 11 +#define RUBY_RELEASE_DAY 6 #include "ruby/version.h" diff --git a/vm_trace.c b/vm_trace.c index 06879812b3..b16ec77e5a 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -730,7 +730,7 @@ tp_memsize(const void *ptr) static const rb_data_type_t tp_data_type = { "tracepoint", - {tp_mark, RUBY_TYPED_NEVER_FREE, tp_memsize,}, + {tp_mark, RUBY_TYPED_DEFAULT_FREE, tp_memsize,}, 0, 0, RUBY_TYPED_FREE_IMMEDIATELY };