summaryrefslogtreecommitdiff
path: root/yjit
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2022-11-29 15:37:29 -0500
committerMaxime Chevalier-Boisvert <maximechevalierb@gmail.com>2022-11-30 12:23:50 -0500
commit03f1e6a2aa8aa1d5aef79a33a243372a457f0fa2 (patch)
treee2a152906a13939ee1d9c04fba3f9f12ce00d918 /yjit
parent817193104dad2eb3f7b9593e2164cc88b3a54887 (diff)
YJIT: Fix IseqPayload::pages memory bloat
HashSet::clear() doesn't deallocate the backing buffer and shrink the capacity. Replace with a 0-capcity set instead so we reclaim some memory each code GC.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6833
Diffstat (limited to 'yjit')
-rw-r--r--yjit/src/asm/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/yjit/src/asm/mod.rs b/yjit/src/asm/mod.rs
index 417d664b07..47e2dca137 100644
--- a/yjit/src/asm/mod.rs
+++ b/yjit/src/asm/mod.rs
@@ -574,7 +574,7 @@ impl CodeBlock {
});
// Avoid accumulating freed pages for future code GC
for_each_off_stack_iseq_payload(|iseq_payload: &mut IseqPayload| {
- iseq_payload.pages.clear();
+ iseq_payload.pages = std::collections::HashSet::default();
});
// Outlined code generated by CodegenGlobals::init() should also be kept.
for page in CodegenGlobals::get_ocb_pages() {