summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGannon McGibbon <gannon.mcgibbon@gmail.com>2024-03-22 15:38:28 -0500
committerPeter Zhu <peter@peterzhu.ca>2024-03-25 10:43:12 -0400
commita31ca3500d995b6706f94ff72166d699c5faeb27 (patch)
tree7a7ec25e4961f69d79916720ade85310af1d296e /include
parent552647175e8319aa7cc117d418f35ed761fdb822 (diff)
Mark iseq structs with rb_gc_mark_movable
Using rb_gc_mark_movable and a reference update function, we can make instruction sequences movable in memory, and avoid pinning compiled iseqs. ``` require "objspace" iseqs = [] GC.disable 50_000.times do iseqs << RubyVM::InstructionSequence.compile("") 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')
0 files changed, 0 insertions, 0 deletions