… | |
… | |
93 | /* the stack */ |
93 | /* the stack */ |
94 | void *sptr; |
94 | void *sptr; |
95 | long ssize; /* positive == mmap, otherwise malloc */ |
95 | long ssize; /* positive == mmap, otherwise malloc */ |
96 | |
96 | |
97 | /* cpu state */ |
97 | /* cpu state */ |
98 | void *idle_sp; /* original stacklevel when coroutine was created */ |
98 | void *idle_sp; /* sp of top-level transfer/schedule/cede call */ |
99 | JMPENV *top_env; |
99 | JMPENV *top_env; |
100 | coro_context cctx; |
100 | coro_context cctx; |
101 | } coro_stack; |
101 | } coro_stack; |
102 | |
102 | |
103 | /* this is a structure representing a perl-level coroutine */ |
103 | /* this is a structure representing a perl-level coroutine */ |
… | |
… | |
229 | if (mg && AvFILLp ((AV *)mg->mg_obj) >= 0) |
229 | if (mg && AvFILLp ((AV *)mg->mg_obj) >= 0) |
230 | CvPADLIST (cv) = (AV *)av_pop ((AV *)mg->mg_obj); |
230 | CvPADLIST (cv) = (AV *)av_pop ((AV *)mg->mg_obj); |
231 | else |
231 | else |
232 | { |
232 | { |
233 | #if 0 |
233 | #if 0 |
234 | /* this should work - but it doesn't :( */ |
234 | /* this is probably cleaner, but also slower? */ |
235 | CV *cp = Perl_cv_clone (aTHX_ cv); |
235 | CV *cp = Perl_cv_clone (aTHX_ cv); |
236 | CvPADLIST (cv) = CvPADLIST (cp); |
236 | CvPADLIST (cv) = CvPADLIST (cp); |
237 | CvPADLIST (cp) = 0; |
237 | CvPADLIST (cp) = 0; |
238 | SvREFCNT_dec (cp); |
238 | SvREFCNT_dec (cp); |
239 | #else |
239 | #else |