fix: GC sweep 复用 Vm.forwarding,消除每轮 HashMap 分配

This commit is contained in:
爱特每羊队
2026-06-24 15:59:55 +08:00
parent 423cd3e56b
commit 41c2b9cba9
5 changed files with 39 additions and 3 deletions
+2
View File
@@ -32,6 +32,7 @@ impl Vm {
epoch: Epoch::new(),
session_epoch: bumpalo::Bump::new(),
session_gc: crate::session_gc::SessionGc::new(),
forwarding: std::collections::HashMap::with_hasher(rustc_hash::FxBuildHasher),
epoch_object_ptrs: Vec::new(),
session_object_ptrs: Vec::new(),
session_bytes_allocated: 0,
@@ -77,6 +78,7 @@ impl Vm {
epoch: Epoch::new(),
session_epoch: bumpalo::Bump::new(),
session_gc: crate::session_gc::SessionGc::new(),
forwarding: std::collections::HashMap::with_hasher(rustc_hash::FxBuildHasher),
epoch_object_ptrs: Vec::new(),
session_object_ptrs: Vec::new(),
session_bytes_allocated: 0,