diff --git a/crates/runtime/src/libcalls.rs b/crates/runtime/src/libcalls.rs index 841dfaa1a2eb..a6b29116727c 100644 --- a/crates/runtime/src/libcalls.rs +++ b/crates/runtime/src/libcalls.rs @@ -406,7 +406,10 @@ pub unsafe extern "C" fn wasmtime_activations_table_insert_with_gc( // Invariant: all `externref`s on the stack have an entry in the activations // table. So we need to ensure that this `externref` is in the table // *before* we GC, even though `insert_with_gc` will ensure that it is in - // the table *after* the GC. + // the table *after* the GC. This technically results in one more hash table + // look up than is strictly necessary -- which we could avoid by having an + // additional GC method that is aware of these GC-triggering references -- + // but it isn't really a concern because this is already a slow path. activations_table.insert_without_gc(externref.clone()); activations_table.insert_with_gc(externref, module_info_lookup);