Skip to documentation
SLOP

tiny.mprompt.Config

Reference tiny.mprompt Config

Defined in tiny.mprompt.

Holds the runtime's tuning values with a C layout, and every field has a default.

API (10)

Fields and members

Public fields and members.

No direct callersNo direct callstiny.mpromptConfig
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/mprompt/src/prompt.zig:37

zig
/// Holds the runtime's tuning values with a C layout, and every field has a default. A program that/// needs larger stacks, another pool size, or fully committed stacks passes one to `init` before it/// creates any prompt. The runtime reads it once, at initialization, and later changes have no/// effect. Sizes are in bytes and are rounded up to whole pages. A size of zero or less selects the/// field's default. `configDefault` returns one with every default.pub const Config = extern struct {    /// When true, each stacklet comes from shared reserved regions cut into equal stacklet-sized    /// blocks (stack pool). When false, each stacklet reserves its own range of address space. The    /// default is true, and overcommit mode turns it off. Every thread of the process takes    /// stacklets from the pool under one lock.    gpool_enable: bool = true,    /// When true, the runtime's fault handler commits extra pages past the faulting page each time    /// a write faults in the uncommitted part of a stacklet. The extra space is twice the stack in    /// use so far, at most 1 MiB, and at most the space left. When false, the runtime commits pages    /// up to the faulting page only. The runtime commits a page by making it readable and writable.    /// The default is true, and overcommit mode turns it off.    stack_grow_fast: bool = true,    /// When true, the runtime commits every page of a stacklet when it takes the stacklet, and it    /// installs no fault handler and no alternate signal stack. Turning it on also turns off the    /// stack pool and fast growth. The default is false.    stack_use_overcommit: bool = false,    /// When true, the runtime makes every page of a stacklet inaccessible when it places the    /// stacklet in a per-thread list of freed stacklets and prompt records for reuse (stack cache),    /// and it also decommits the used pages of a pooled stacklet it frees. When false, a cached    /// stacklet keeps its pages, and a pooled stacklet that is freed has its used pages discarded,    /// so their contents are dropped. The default is false.    stack_reset_decommits: bool = false,    /// The size in bytes of each region of the stack pool. A region holds as many stacklets as fit    /// in this size, at least 1 and at most 32,000. The process reserves another region when every    /// block of the existing ones is in use. The default is 256 GiB of address space.    gpool_max_size: isize = 256 * gib,    /// The reserved size of each stacklet in bytes, the two gaps included, so the usable stack is    /// this size minus twice `stack_gap_size`. The default is 8 MiB. Initialization stops the    /// program with a panic when the size leaves one page or less of usable stack. A write past the    /// usable stack lands in a gap, which the runtime never commits, so the fault goes to the    /// program's earlier fault handler, or the process aborts when there was none.    stack_max_size: isize = 8 * mib,    /// The runtime reads nothing from this field, so its value has no effect. The default is 32    /// KiB.    stack_exn_guaranteed: isize = 32 * kib,    /// The number of bytes of a new stacklet committed when the runtime takes it, rounded up to    /// whole pages. The default of 0 means one page. The runtime caps it at the stacklet's usable    /// size.    stack_initial_commit: isize = 0,    /// The size in bytes of the unmapped gap at each end of a stacklet, rounded up to whole pages.    /// The default is 64 KiB.    stack_gap_size: isize = 64 * kib,    /// The number of freed stacklets, and separately the number of freed prompt records, that each    /// thread keeps for reuse. The default is 4. A negative value becomes 0, which turns the reuse    /// off.    stack_cache_count: isize = 4,};

Source: lib/mprompt/src/root.zig:74

zig
pub const Config = raw.Config;

Audit

Definitions1
Public names1
Members10
Version26.7.0
Revisiondaab053ee433