Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/intern/src/gc.rs')
-rw-r--r--crates/intern/src/gc.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/intern/src/gc.rs b/crates/intern/src/gc.rs
index 937de26831..f4e8f75e71 100644
--- a/crates/intern/src/gc.rs
+++ b/crates/intern/src/gc.rs
@@ -110,6 +110,10 @@ impl GarbageCollector {
/// the added storages must form a DAG.
/// - [`GcInternedVisit`] and [`GcInternedSliceVisit`] must mark all values reachable from the node.
pub unsafe fn collect(mut self) {
+ if cfg!(feature = "prevent-gc") {
+ return;
+ }
+
let total_nodes = self.storages.iter().map(|storage| storage.len()).sum();
self.alive.clear();
self.alive.reserve(total_nodes);