Fast fibers/coroutines under x64 Windows
问题 So I have this coroutine API, extended by me, based on code I found here: https://the8bitpimp.wordpress.com/2014/10/21/coroutines-x64-and-visual-studio/ struct mcontext { U64 regs[8]; U64 stack_pointer; U64 return_address; U64 coroutine_return_address; }; struct costate { struct mcontext callee; struct mcontext caller; U32 state; }; void coprepare(struct costate **token, void *stack, U64 stack_size, cofunc_t func); /* C code */ void coenter(struct costate *token, void *arg); /* ASM code */