| 2172 | /// WebAssembly linear memory. |
| 2173 | #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq, Serialize, Deserialize)] |
| 2174 | pub struct Memory { |
| 2175 | /// The type of the index used to access the memory. |
| 2176 | pub idx_type: IndexType, |
| 2177 | /// The limits constrain the minimum and optionally the maximum size of a memory. |
| 2178 | /// The limits are given in units of page size. |
| 2179 | pub limits: Limits, |
| 2180 | /// Whether the memory may be shared between multiple threads. |
| 2181 | pub shared: bool, |
| 2182 | /// The log2 of this memory's page size, in bytes. |
| 2183 | /// |
| 2184 | /// By default the page size is 64KiB (0x10000; 2**16; 1<<16; 65536) but the |
| 2185 | /// custom-page-sizes proposal allows opting into a page size of `1`. |
| 2186 | pub page_size_log2: u8, |
| 2187 | } |
| 2188 | |
| 2189 | /// Maximum size, in bytes, of 32-bit memories (4G) |
| 2190 | pub const WASM32_MAX_SIZE: u64 = 1 << 32; |
no outgoing calls
no test coverage detected