Skip to main content

MAX_SEGMENT_BORROWS

Constant MAX_SEGMENT_BORROWS 

Source
pub const MAX_SEGMENT_BORROWS: usize = 16;
Expand description

Maximum simultaneous segment borrows per instruction.

16 covers any realistic instruction, most use 2-6 segments. Keeping it fixed avoids heap allocation while staying well within Solana’s CU budget. The compact entry representation keeps the total stack footprint under 200 bytes.