This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <csetjmp> | |
class CoroutineImpl { | |
public: | |
using CalledFunction = void(*)(CoroutineImpl*); | |
CoroutineImpl(CalledFunction func) { | |
m_stackSize = 8 * 1024; | |
m_stackPointer = malloc(m_stackSize); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <inttypes.h> | |
/** Useless macro boilerplate, I will eventually make it less hacky, I think **/ | |
#define EVAL(...) EVAL1(EVAL1(EVAL1(__VA_ARGS__))) | |
#define EVAL1(...) EVAL2(EVAL2(EVAL2(__VA_ARGS__))) |
NewerOlder