From a777ec0d85f1d52ddf531931c7457a65961f0082 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Wed, 16 Nov 2022 16:30:39 -0800 Subject: [PATCH] YJIT: Shrink version lists after mutation (#6749) --- yjit/src/core.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/yjit/src/core.rs b/yjit/src/core.rs index ad74067ea0..78b4cbdb0c 100644 --- a/yjit/src/core.rs +++ b/yjit/src/core.rs @@ -878,6 +878,7 @@ fn add_block_version(blockref: &BlockRef, cb: &CodeBlock) { let version_list = get_or_create_version_list(block.blockid); version_list.push(blockref.clone()); + version_list.shrink_to_fit(); // By writing the new block to the iseq, the iseq now // contains new references to Ruby objects. Run write barriers.