… | |
… | |
221 | |
221 | |
222 | /* process data */ |
222 | /* process data */ |
223 | AV *mainstack; |
223 | AV *mainstack; |
224 | perl_slots *slot; /* basically the saved sp */ |
224 | perl_slots *slot; /* basically the saved sp */ |
225 | |
225 | |
226 | /* data associated with this coroutine (initial args) */ |
226 | AV *args; /* data associated with this coroutine (initial args) */ |
227 | AV *args; |
227 | int refcnt; /* coroutines are refcounted, yes */ |
228 | int refcnt; |
|
|
229 | int flags; /* CF_ flags */ |
228 | int flags; /* CF_ flags */ |
|
|
229 | HV *hv; /* the perl hash associated with this coro, if any */ |
230 | |
230 | |
231 | /* statistics */ |
231 | /* statistics */ |
232 | int usecount; /* number of transfers to this coro */ |
232 | int usecount; /* number of transfers to this coro */ |
233 | |
233 | |
234 | /* coro process data */ |
234 | /* coro process data */ |
235 | int prio; |
235 | int prio; |
236 | SV *throw; |
236 | SV *throw; /* exception to be thrown */ |
237 | |
237 | |
238 | /* async_pool */ |
238 | /* async_pool */ |
239 | SV *saved_deffh; |
239 | SV *saved_deffh; |
240 | |
240 | |
241 | /* linked list */ |
241 | /* linked list */ |
242 | struct coro *next, *prev; |
242 | struct coro *next, *prev; |
243 | HV *hv; /* the perl hash associated with this coro, if any */ |
|
|
244 | }; |
243 | }; |
245 | |
244 | |
246 | typedef struct coro *Coro__State; |
245 | typedef struct coro *Coro__State; |
247 | typedef struct coro *Coro__State_or_hashref; |
246 | typedef struct coro *Coro__State_or_hashref; |
248 | |
247 | |
… | |
… | |
557 | * allocate various perl stacks. This is an exact copy |
556 | * allocate various perl stacks. This is an exact copy |
558 | * of perl.c:init_stacks, except that it uses less memory |
557 | * of perl.c:init_stacks, except that it uses less memory |
559 | * on the (sometimes correct) assumption that coroutines do |
558 | * on the (sometimes correct) assumption that coroutines do |
560 | * not usually need a lot of stackspace. |
559 | * not usually need a lot of stackspace. |
561 | */ |
560 | */ |
562 | #if 1 |
561 | #if CORO_PREFER_PERL_FUNCTIONS |
563 | # define coro_init_stacks init_stacks |
562 | # define coro_init_stacks init_stacks |
564 | #else |
563 | #else |
565 | static void |
564 | static void |
566 | coro_init_stacks (pTHX) |
565 | coro_init_stacks (pTHX) |
567 | { |
566 | { |