MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / table_fill_doesnt_leak

Function table_fill_doesnt_leak

tests/all/gc.rs:836–856  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

834
835#[test]
836fn table_fill_doesnt_leak() -> Result<()> {
837 let _ = env_logger::try_init();
838
839 let mut store = Store::<()>::default();
840 let flag = Arc::new(AtomicBool::new(false));
841
842 {
843 let mut scope = RootScope::new(&mut store);
844 let x = ExternRef::new(&mut scope, SetFlagOnDrop(flag.clone()))?;
845 let table = Table::new(
846 &mut scope,
847 TableType::new(RefType::EXTERNREF, 10, Some(10)),
848 x.into(),
849 )?;
850 table.fill(&mut scope, 0, Ref::Extern(None), 10)?;
851 }
852
853 store.gc(None)?;
854 assert!(flag.load(SeqCst));
855 Ok(())
856}
857
858#[test]
859#[cfg_attr(miri, ignore)]

Callers

nothing calls this directly

Calls 7

OkFunction · 0.85
SetFlagOnDropClass · 0.70
newFunction · 0.50
ExternEnum · 0.50
cloneMethod · 0.45
fillMethod · 0.45
gcMethod · 0.45

Tested by

no test coverage detected