Zth (libzth)
stack

Macros

#define zth_stack_switch(stack, size, f, arg)
 Call the function f using the new stack pointer. More...
 

Detailed Description

Macro Definition Documentation

◆ zth_stack_switch

#define zth_stack_switch (   stack,
  size,
  f,
  arg 
)

Call the function f using the new stack pointer.

Parameters
stackthe new stack area. If nullptr, the Worker's stack is used. If size is 0, this is the stack pointer, otherwise the stack pointer is calculated according to the ABI (growing up/down) within stack + size.
sizethe new stack size. This is not required to make the jump, but if 0, there will not be any stack overflow guard used.
fthe function with prototype void*(void*) to be called. When f returns, the previous stack is restored.
argthe argument to pass to f.

Definition at line 41 of file context.h.