ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro/State.xs
(Generate patch)

Comparing Coro/Coro/State.xs (file contents):
Revision 1.59 by root, Mon Jul 19 01:32:27 2004 UTC vs.
Revision 1.61 by root, Tue Aug 10 01:56:30 2004 UTC

270 AV *av = (AV *)mg->mg_obj; 270 AV *av = (AV *)mg->mg_obj;
271 271
272 /* casting is fun. */ 272 /* casting is fun. */
273 while (&PL_sv_undef != (SV *)(padlist = (AV *)av_pop (av))) 273 while (&PL_sv_undef != (SV *)(padlist = (AV *)av_pop (av)))
274 free_padlist (aTHX_ padlist); 274 free_padlist (aTHX_ padlist);
275
276 SvREFCNT_dec (av);
275} 277}
276 278
277#define PERL_MAGIC_coro PERL_MAGIC_ext 279#define PERL_MAGIC_coro PERL_MAGIC_ext
278 280
279static MGVTBL vtbl_coro = {0, 0, 0, 0, coro_cv_free}; 281static MGVTBL vtbl_coro = {0, 0, 0, 0, coro_cv_free};
1015 if (coro->mainstack && coro->mainstack != main_mainstack) 1017 if (coro->mainstack && coro->mainstack != main_mainstack)
1016 { 1018 {
1017 struct coro temp; 1019 struct coro temp;
1018 1020
1019 PUTBACK; 1021 PUTBACK;
1020 SAVE(aTHX_ (&temp), TRANSFER_SAVE_ALL); 1022 SAVE (aTHX_ (&temp), TRANSFER_SAVE_ALL);
1021 LOAD(aTHX_ coro); 1023 LOAD (aTHX_ coro);
1022 SPAGAIN; 1024 SPAGAIN;
1023 1025
1024 destroy_stacks (aTHX); 1026 destroy_stacks (aTHX);
1025 1027
1026 LOAD((&temp)); /* this will get rid of defsv etc.. */ 1028 LOAD ((&temp)); /* this will get rid of defsv etc.. */
1027 SPAGAIN; 1029 SPAGAIN;
1028 1030
1029 coro->mainstack = 0; 1031 coro->mainstack = 0;
1030 } 1032 }
1031 1033
1060 av_clear (defav); 1062 av_clear (defav);
1061 av_fill (defav, items - 1); 1063 av_fill (defav, items - 1);
1062 while (items--) 1064 while (items--)
1063 av_store (defav, items, SvREFCNT_inc (ST(items))); 1065 av_store (defav, items, SvREFCNT_inc (ST(items)));
1064 1066
1065 mg_get (returnstk); /* isn't documentation wrong for mg_get? */ 1067 SvGETMAGIC (returnstk); /* isn't documentation wrong for mg_get? */
1066 sv = av_pop ((AV *)SvRV (returnstk)); 1068 sv = av_pop ((AV *)SvRV (returnstk));
1067 prev = (struct coro *)SvIV ((SV*)SvRV (*av_fetch ((AV *)SvRV (sv), 0, 0))); 1069 prev = (struct coro *)SvIV ((SV*)SvRV (*av_fetch ((AV *)SvRV (sv), 0, 0)));
1068 next = (struct coro *)SvIV ((SV*)SvRV (*av_fetch ((AV *)SvRV (sv), 1, 0))); 1070 next = (struct coro *)SvIV ((SV*)SvRV (*av_fetch ((AV *)SvRV (sv), 1, 0)));
1069 SvREFCNT_dec (sv); 1071 SvREFCNT_dec (sv);
1070 1072
1071 transfer(aTHX_ prev, next, 0); 1073 transfer (aTHX_ prev, next, 0);
1072 1074
1073MODULE = Coro::State PACKAGE = Coro 1075MODULE = Coro::State PACKAGE = Coro
1074 1076
1075# this is slightly dirty (should expose a c-level api) 1077# this is slightly dirty (should expose a c-level api)
1076 1078

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines