MCPcopy Index your code
hub / github.com/dispatchrun/coroutine / Push

Function Push

coroutine_durable.go:69–75  ·  view source on GitHub ↗

Push prepares the stack for an impending function call. The stack's frame pointer is incremented, and the stack is resized to make room for a new frame if the caller is on the topmost frame. If the caller is not on the topmost frame it means that a coroutine is being resumed and the next frame is

(s *Stack)

Source from the content-addressed store, hash-verified

67// intending to serialize the stack should call Store(fp, frame) for each
68// frame during stack unwinding.
69func Push[Frame any](s *Stack) *Frame {
70 if s.isTop() {
71 s.Frames = append(s.Frames, new(Frame))
72 }
73 s.FP++
74 return s.Frames[s.FP].(*Frame)
75}
76
77// Pop pops the topmost stack frame after a function call.
78func Pop(s *Stack) {

Callers

nothing calls this directly

Calls 1

isTopMethod · 0.80

Tested by

no test coverage detected