Skip to main content

TOTAL_GROW_CAP

Constant TOTAL_GROW_CAP 

Source
pub const TOTAL_GROW_CAP: usize = _; // 1_048_576usize
Expand description

Soft cap on total entries (array + hash) used to emulate C-Lua’s malloc-NULL termination of unbounded for i = 1, math.huge do a[i] = ... end loops. C-Lua hits real malloc failure at multi-gigabyte allocations; we raise LuaError::Memory (which pcall catches as "not enough memory") once the table exceeds this size. Sized well above any realistic test workload (big.lua uses ~264K entries) while bounded enough that heavy.lua terminates within the harness timeout.