Zth (libzth)
context.h File Reference
#include <libzth/config.h>
#include <libzth/util.h>
#include <tuple>

Go to the source code of this file.

Classes

struct  zth::ContextAttr
 
struct  zth::impl::Packed< T >
 
struct  zth::impl::Packed< T & >
 
struct  zth::impl::Arguments< A >
 
struct  zth::impl::FunctionION< R, A, A_ >
 
struct  zth::impl::FunctionION< void, A, A_ >
 

Namespaces

 zth
 
 zth::impl
 

Macros

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

Functions

int zth::context_init () noexcept
 One-time context mechanism initialization. More...
 
void zth::context_deinit () noexcept
 Final cleanup. More...
 
int zth::context_create (Context *&context, ContextAttr const &attr) noexcept
 Create a context. More...
 
void zth::context_switch (Context *from, Context *to) noexcept
 Perform context switch. More...
 
void zth::context_destroy (Context *context) noexcept
 Destroy and cleanup a context. More...
 
size_t zth::context_stack_usage (Context *context) noexcept
 Return the high water mark of the stack of the given context. More...
 
void zth::stack_watermark_init (void *stack, size_t size) noexcept
 Initialize the memory region for stack high water marking. More...
 
size_t zth::stack_watermark_size (void *stack) noexcept
 Return the size of the given stack region. More...
 
size_t zth::stack_watermark_maxused (void *stack) noexcept
 Return the high water mark of the stack. More...
 
size_t zth::stack_watermark_remaining (void *stack) noexcept
 Return the remaining stack size that was never touched. More...
 
template<typename F >
void * zth::impl::stack_switch_fwd (void *f) noexcept
 
template<typename R , typename... A, typename... A_>
std::enable_if<!std::is_void< R >::value, R >::type zth::stack_switch (void *stack, size_t size, R(*f)(A...) noexcept, A_ &&... a) noexcept
 Call the function f using the new stack pointer. More...
 
template<typename... A, typename... A_>
void zth::stack_switch (void *stack, size_t size, void(*f)(A...) noexcept, A_ &&... a) noexcept
 Call the function f using the new stack pointer. More...
 

Macro Definition Documentation

◆ ZTH_STACK_SWITCH98

#define ZTH_STACK_SWITCH98   0

Definition at line 63 of file context.h.