… | |
… | |
55 | * |
55 | * |
56 | * -DCORO_UCONTEXT |
56 | * -DCORO_UCONTEXT |
57 | * |
57 | * |
58 | * This flavour uses SUSv2's get/set/swap/makecontext functions that |
58 | * This flavour uses SUSv2's get/set/swap/makecontext functions that |
59 | * unfortunately only newer unices support. |
59 | * unfortunately only newer unices support. |
60 | * Use this for GNU/Linux + glibc-2.2.3. |
60 | * Use this for GNU/Linux + glibc-2.2.3 and possibly higher. |
61 | * |
61 | * |
62 | * -DCORO_SJLJ |
62 | * -DCORO_SJLJ |
63 | * |
63 | * |
64 | * This flavour uses SUSv'2 setjmp/longjmp and sigaltstack functions to |
64 | * This flavour uses SUSv2's setjmp/longjmp and sigaltstack functions to |
65 | * do it's job. Coroutine creation is much slower than UCONTEXT, but |
65 | * do it's job. Coroutine creation is much slower than UCONTEXT, but |
66 | * context switching is often a bit cheaper. It should work on almost |
66 | * context switching is often a bit cheaper. It should work on almost |
67 | * all unices. Use this for GNU/Linux + glibc-2.2. glibc-2.1 and below |
67 | * all unices. Use this for GNU/Linux + glibc-2.2. glibc-2.1 and below |
68 | * do not work with any sane model (neither sigaltstack nor context |
68 | * do not work with any sane model (neither sigaltstack nor context |
69 | * functions are implemented) |
69 | * functions are implemented) |
70 | * |
70 | * |
71 | * -DCORO_LINUX |
71 | * -DCORO_LINUX |
72 | * |
72 | * |
73 | * Old GNU/Linux systems (<= glibc-2.1) work with this implementation |
73 | * Old GNU/Linux systems (<= glibc-2.1) work with this implementation |
74 | * (very fast). |
74 | * (it is very fast and therefore recommended over other methods). |
75 | * |
75 | * |
76 | * -DCORO_LOSER |
76 | * -DCORO_LOSER |
77 | * |
77 | * |
78 | * Microsoft's highly proprietary platform doesn't support sigaltstack, and |
78 | * Microsoft's highly proprietary platform doesn't support sigaltstack, and |
79 | * this automatically selects a suitable workaround for this platform. |
79 | * this automatically selects a suitable workaround for this platform. |
… | |
… | |
101 | */ |
101 | */ |
102 | typedef struct coro_context coro_context; |
102 | typedef struct coro_context coro_context; |
103 | |
103 | |
104 | /* |
104 | /* |
105 | * This function creates a new coroutine. Apart from a pointer to an |
105 | * This function creates a new coroutine. Apart from a pointer to an |
106 | * uninitialized coro_context, it expects a pointer to the entry function |
106 | * uninitialised coro_context, it expects a pointer to the entry function |
107 | * and the single pointer value that is given to it as argument. |
107 | * and the single pointer value that is given to it as argument. |
108 | * |
108 | * |
109 | * Allocating/deallocating the stack is your own responsibility, so there is |
109 | * Allocating/deallocating the stack is your own responsibility, so there is |
110 | * no coro_destroy function. |
110 | * no coro_destroy function. |
111 | */ |
111 | */ |