Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Disable `Tombstone` insertion in `ResourceTable` by default (#12114)

Alex Crichtondd06e7a5c9df
diff --git a/crates/wasmtime/src/runtime/component/resource_table.rs b/crates/wasmtime/src/runtime/component/resource_table.rs
index e427518bb2..d6264ab919 100644
--- a/crates/wasmtime/src/runtime/component/resource_table.rs
+++ b/crates/wasmtime/src/runtime/component/resource_table.rs
@@ -62,6 +62,10 @@ impl Entry {
struct Tombstone;
+// Change this to `true` to assist with handle debugging in development if
+// necessary.
+const DELETE_WITH_TOMBSTONE: bool = false;
+
/// This structure tracks parent and child relationships for a given table entry.
///
/// Parents and children are referred to by table index. We maintain the
@@ -311,7 +315,7 @@ impl ResourceTable {
where
T: Any,
{
- self.delete_maybe_debug(resource, cfg!(debug_assertions))
+ self.delete_maybe_debug(resource, DELETE_WITH_TOMBSTONE)
}
fn delete_maybe_debug<T>(