Skip to content

Instantly share code, notes, and snippets.

@chunseoklee
chunseoklee / amd64_sysv.h
Created September 8, 2016 00:05 — forked from cutthroat/amd64_sysv.h
Simple C coroutines on AMD64/SysV
#pragma once
/* Each coroutine is represented by a pointer to its stack bottom. */
typedef void *co_coro;
/* The coroutine procedure takes the calling coroutine as its first argument. */
typedef void (*co_proc)(co_coro back);
/* Switch to new coroutine. The stack top must be 16 byte aligned.*/