Constant MAX_MEMORY_SIZE

Source
pub const MAX_MEMORY_SIZE: usize = _; // 2_147_483_647usize
Expand description

Maximum number of memory slots that can be allocated.

This limit is set to i32::MAX to ensure deterministic behavior across all architectures. On 32-bit systems, Rust’s allocator limits allocations to isize::MAX bytes, which would restrict us to fewer elements anyway. By using i32::MAX, we ensure the same behavior on both 32-bit and 64-bit systems.

See: https://github.com/rust-lang/rust/pull/95295 and https://doc.rust-lang.org/1.81.0/src/core/alloc/layout.rs.html