Skip to content

Commit dd06e7a

Browse files
authored
Disable Tombstone insertion in ResourceTable by default (#12114)
This was useful in the development of WASIp3 but given the relatively big change in behavior to a foundational data structure I don't think it's best to keep this tied to `cfg!(debug_assertions)`. Instead disable it by default and use a source-editing approach to change it.
1 parent 99ecf72 commit dd06e7a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/wasmtime/src/runtime/component/resource_table.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ impl Entry {
6262

6363
struct Tombstone;
6464

65+
// Change this to `true` to assist with handle debugging in development if
66+
// necessary.
67+
const DELETE_WITH_TOMBSTONE: bool = false;
68+
6569
/// This structure tracks parent and child relationships for a given table entry.
6670
///
6771
/// Parents and children are referred to by table index. We maintain the
@@ -311,7 +315,7 @@ impl ResourceTable {
311315
where
312316
T: Any,
313317
{
314-
self.delete_maybe_debug(resource, cfg!(debug_assertions))
318+
self.delete_maybe_debug(resource, DELETE_WITH_TOMBSTONE)
315319
}
316320

317321
fn delete_maybe_debug<T>(

0 commit comments

Comments
 (0)