wasmtime/runtime/vm/gc/
enabled.rs

1//! Implementation of garbage collection and GC types in Wasmtime.
2
3mod arrayref;
4mod data;
5mod externref;
6#[cfg(feature = "gc-drc")]
7mod free_list;
8mod structref;
9
10pub use arrayref::*;
11pub use data::*;
12pub use externref::*;
13pub use structref::*;
14
15#[cfg(feature = "gc-drc")]
16mod drc;
17#[cfg(feature = "gc-drc")]
18pub use drc::*;
19
20#[cfg(feature = "gc-null")]
21mod null;
22#[cfg(feature = "gc-null")]
23pub use null::*;
24
25/// The default GC heap capacity.
26//
27// Note that this is a bit smaller for miri to avoid overheads.
28#[cfg(any(feature = "gc-drc", feature = "gc-null"))]
29const DEFAULT_GC_HEAP_CAPACITY: usize = if cfg!(miri) { 1 << 16 } else { 1 << 19 };
30
31// Explicit methods with `#[allow]` to clearly indicate that truncation is
32// desired when used.
33#[allow(clippy::cast_possible_truncation)]
34fn truncate_i32_to_i16(a: i32) -> i16 {
35    a as i16
36}
37
38#[allow(clippy::cast_possible_truncation)]
39fn truncate_i32_to_i8(a: i32) -> i8 {
40    a as i8
41}