Created
January 28, 2014 20:28
Revisions
-
Juan Wajnerman created this gist
Jan 28, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ #include <gc/gc.h> #include <pcl.h> #include <stdio.h> void coroutine(void *arg) { int i; for (i = 0; i < 1000; ++i) { printf("%d\n", i); GC_malloc(1024); } } #define STACK_SIZE 32 * 1024 int main(int argc, char const *argv[]) { GC_init(); void *stack = GC_malloc(STACK_SIZE); coroutine_t c = co_create(coroutine, 0, stack, STACK_SIZE); co_call(c); return 0; }