Skip to documentation
SLOP

tiny.mprompt.promptCreate

Reference tiny.mprompt promptCreate

Defined in tiny.mprompt.

Returns a new prompt with one owner, its own stacklet, and no saved registers, so a caller creates a prompt ahead of the call that enters it.

Called byCallstiny.mpromptprompttest sourcelib.mprompt.src.prompttest: completed prompts reuse cached ...private sourcelib.mprompt.src.prompt.GStackallocprivate sourcelib.mprompt.src.promptensureInitializedprivate sourcelib.mprompt.src.promptpromptAlloctiny.mpromptpromptCreate
Static calls · unresolved targets: 0 · external targets: 0.

Source

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

zig
/// Returns a new prompt with one owner, its own stacklet, and no saved registers, so a caller/// creates a prompt ahead of the call that enters it. The record comes from the calling thread's/// stack cache or from the process allocator. The stacklet comes from the stack cache, when a/// cached one lies below the caller's stack pointer, or from a new reservation. The first call in a/// process initializes the runtime with the defaults when `init` has not run. The program stops/// with a panic when memory for the record or the stacklet cannot be had. The caller enters the/// prompt with `promptEnter`, and a prompt that is never entered keeps its stacklet.pub fn promptCreate() *Prompt {    if (!initialized) ensureInitialized(null);    const p = promptAlloc();    p.* = .{        .parent = null,        .top = p,        .refcount = 1,        .gstack = GStack.alloc(),        .return_point = null,        .resume_point = null,        .sp = null,        .unwind_frame = null,    };    return p;}

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

zig
pub const promptCreate = raw.promptCreate;

Audit

Definitions1
Public names1
Members0
Version26.7.0
Revisiondaab053ee433