| 834 | |
| 835 | #[test] |
| 836 | fn 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)] |