Skip to content

Commit 19f8d94

Browse files
committed
Expand on activations table invariants comment in libcalls.rs
1 parent f292ff5 commit 19f8d94

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: crates/runtime/src/libcalls.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,10 @@ pub unsafe extern "C" fn wasmtime_activations_table_insert_with_gc(
406406
// Invariant: all `externref`s on the stack have an entry in the activations
407407
// table. So we need to ensure that this `externref` is in the table
408408
// *before* we GC, even though `insert_with_gc` will ensure that it is in
409-
// the table *after* the GC.
409+
// the table *after* the GC. This technically results in one more hash table
410+
// look up than is strictly necessary -- which we could avoid by having an
411+
// additional GC method that is aware of these GC-triggering references --
412+
// but it isn't really a concern because this is already a slow path.
410413
activations_table.insert_without_gc(externref.clone());
411414

412415
activations_table.insert_with_gc(externref, module_info_lookup);

0 commit comments

Comments
 (0)