pub const MAX_SHARDS: usize = _; // 65_536usizeExpand description
Largest shard count any arena may be configured with.
A shard count arrives from an untrusted snapshot, and Arena::new turns it
straight into three vectors plus a page pool — so it is an allocation size
taken from a file, and those need a ceiling. This one is derived, not
picked:
MAX_SHARDS * PAGE_BYTESis 256 MiB, which fits a 32-bitusize, so page arithmetic cannot overflow on wasm32;- per-shard runtime metadata stays bounded at
MAX_SHARDS * SHARD_META_BYTES(768 KiB) per arena; - it cannot bind on a database that can actually exist: the default 2 GiB
pool ceiling at
SHARD_TARGET_BYTESper shard justifies at most2 GiB / SHARD_TARGET_BYTES≈ 43690 shards, which rounds up to exactly this value. Anything larger describes a database no pool could hold.