1#![warn(clippy::cast_possible_truncation)]
28
29#[cfg(feature = "component-model-async")]
30mod bug;
31
32#[macro_use]
33pub(crate) mod func;
34
35pub(crate) mod code;
36pub(crate) mod code_memory;
37#[cfg(feature = "debug")]
38pub(crate) mod debug;
39#[cfg(feature = "gc")]
40pub(crate) mod exception;
41pub(crate) mod externals;
42#[cfg(feature = "async")]
43pub(crate) mod fiber;
44pub(crate) mod gc;
45pub(crate) mod instance;
46pub(crate) mod instantiate;
47pub(crate) mod limits;
48pub(crate) mod linker;
49pub(crate) mod memory;
50pub(crate) mod module;
51#[cfg(feature = "debug-builtins")]
52pub(crate) mod native_debug;
53pub(crate) mod resources;
54pub(crate) mod store;
55pub(crate) mod trampoline;
56pub(crate) mod trap;
57pub(crate) mod type_registry;
58pub(crate) mod types;
59pub(crate) mod v128;
60pub(crate) mod values;
61pub(crate) mod vm;
62
63#[cfg(feature = "component-model")]
64pub mod component;
65
66cfg_if::cfg_if! {
67 if #[cfg(miri)] {
68 } else if #[cfg(not(feature = "std"))] {
70 } else if #[cfg(unix)] {
72 pub mod unix;
73 } else if #[cfg(windows)] {
74 pub mod windows;
75 } else {
76 }
78}
79
80#[cfg(feature = "component-model-async")]
81pub use bug::WasmtimeBug;
82#[cfg(feature = "component-model-async")]
83pub(crate) use bug::bail_bug;
84pub use code_memory::CodeMemory;
85#[cfg(feature = "debug")]
86pub use debug::*;
87#[cfg(feature = "gc")]
88pub use exception::*;
89pub use externals::*;
90pub use func::*;
91pub use gc::*;
92pub use instance::{Instance, InstancePre};
93pub use instantiate::CompiledModule;
94pub use limits::*;
95pub use linker::*;
96pub use memory::*;
97pub use module::{Module, ModuleExport};
98pub use resources::*;
99#[cfg(all(feature = "async", feature = "call-hook"))]
100pub use store::CallHookHandler;
101pub use store::{
102 AsContext, AsContextMut, CallHook, Store, StoreContext, StoreContextMut, UpdateDeadline,
103};
104pub use trap::*;
105pub use types::*;
106pub use v128::V128;
107pub use values::*;
108
109#[cfg(feature = "pooling-allocator")]
110pub use vm::{PoolConcurrencyLimitError, PoolingAllocatorMetrics};
111
112#[cfg(feature = "profiling")]
113mod profiling;
114#[cfg(feature = "profiling")]
115pub use profiling::GuestProfiler;
116
117#[cfg(feature = "async")]
118pub(crate) mod stack;
119#[cfg(feature = "async")]
120pub use stack::*;
121
122#[cfg(feature = "coredump")]
123mod coredump;
124#[cfg(feature = "coredump")]
125pub use coredump::*;
126
127#[cfg(feature = "wave")]
128mod wave;
129
130fn _assertions_runtime() {
131 use crate::_assert_send_and_sync;
132
133 #[cfg(feature = "async")]
134 fn _assert_send<T: Send>(_t: T) {}
135
136 _assert_send_and_sync::<Caller<'_, ()>>();
137 _assert_send_and_sync::<ExternRef>();
138 _assert_send_and_sync::<(Func, TypedFunc<(), ()>, Global, Table, Memory)>();
139 _assert_send_and_sync::<Instance>();
140 _assert_send_and_sync::<InstancePre<()>>();
141 _assert_send_and_sync::<InstancePre<*mut u8>>();
142 _assert_send_and_sync::<Linker<()>>();
143 _assert_send_and_sync::<Linker<*mut u8>>();
144 _assert_send_and_sync::<Module>();
145 _assert_send_and_sync::<Store<()>>();
146 _assert_send_and_sync::<StoreContext<'_, ()>>();
147 _assert_send_and_sync::<StoreContextMut<'_, ()>>();
148
149 #[cfg(feature = "async")]
150 fn _call_async(s: &mut Store<()>, f: Func) {
151 _assert_send(f.call_async(&mut *s, &[], &mut []))
152 }
153 #[cfg(feature = "async")]
154 fn _typed_call_async(s: &mut Store<()>, f: TypedFunc<(), ()>) {
155 _assert_send(f.call_async(&mut *s, ()))
156 }
157 #[cfg(feature = "async")]
158 fn _instantiate_async(s: &mut Store<()>, m: &Module) {
159 _assert_send(Instance::new_async(s, m, &[]))
160 }
161}