tiny.mprompt.resumeMulti
Defined in tiny.mprompt.
Returns a multi-shot handle for the same suspend, so a yield function converts its handle before resuming the same suspend more than once.
Source
Source: lib/mprompt/src/prompt.zig:629
zig
/// Returns a multi-shot handle for the same suspend, so a yield function converts its handle before/// resuming the same suspend more than once. The caller uses the returned handle in place of/// `resume_ptr`. Converting a one-shot handle allocates a record from the process allocator, and/// the record starts with one reference. The program stops with a panic if that allocation fails. A/// handle that is already multi-shot comes back unchanged.pub fn resumeMulti(resume_ptr: *Resume) *Resume { if (resumeIsMulti(resume_ptr)) |_| { @branchHint(.unlikely); return resume_ptr; } const p = resumeIsOnce(resume_ptr).?; const mr = processAllocator().create(MResume) catch fatal("unable to allocate multi-shot resume", .{}); mr.* = .{ .refcount = 1, .resume_count = 0, .prompt = p, .save = null, .tail_return_point = p.return_point, }; return resumeAsMulti(mr);}Source: lib/mprompt/src/root.zig:89
zig
pub const resumeMulti = raw.resumeMulti;Audit
| Definitions | 1 |
|---|---|
| Public names | 1 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |