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.
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
| Definitions | 1 |
|---|---|
| Public names | 1 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |