diff options
| author | Gannon McGibbon <gannon.mcgibbon@gmail.com> | 2024-03-22 15:40:42 -0500 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2024-03-26 13:53:00 -0400 |
| commit | 4bdb79618b33422551e96723827e50ab20e9abb1 (patch) | |
| tree | 164dd7030ca35384c6699983cec2dca271451313 /include/ruby | |
| parent | 4300c42a7eb12a0aa81e4ec79891cdba1cfdf3aa (diff) | |
Mark frame info structs with rb_gc_mark_movable
Using rb_gc_mark_movable and a reference update function, we can make
frame infos movable in memory, and avoid pinning frame info backtraces.
```
require "objspace"
exceptions = []
GC.disable
50_000.times do
begin
raise "some exception"
rescue => exception
exception.backtrace_locations
exceptions << exception
end
end
GC.enable
GC.compact
p ObjectSpace.dump_all(output: :string).lines.grep(/"pinned":true/).count
```
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
Diffstat (limited to 'include/ruby')
0 files changed, 0 insertions, 0 deletions
