Expand on activations table invariants comment in libcalls.rs
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user