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.336 by root, Thu Dec 4 17:29:40 2008 UTC vs.
Revision 1.337 by root, Fri Dec 5 18:26:10 2008 UTC

938 /* copy throw, in case it was set before coro_setup */ 938 /* copy throw, in case it was set before coro_setup */
939 CORO_THROW = coro->except; 939 CORO_THROW = coro->except;
940} 940}
941 941
942static void 942static void
943coro_destruct_perl (pTHX_ struct coro *coro) 943coro_unwind_stacks (pTHX)
944{ 944{
945 if (!IN_DESTRUCT) 945 if (!IN_DESTRUCT)
946 { 946 {
947 /* restore all saved variables and stuff */ 947 /* restore all saved variables and stuff */
948 LEAVE_SCOPE (0); 948 LEAVE_SCOPE (0);
956 POPSTACK_TO (PL_mainstack); 956 POPSTACK_TO (PL_mainstack);
957 957
958 /* unwind main stack */ 958 /* unwind main stack */
959 dounwind (-1); 959 dounwind (-1);
960 } 960 }
961}
962
963static void
964coro_destruct_perl (pTHX_ struct coro *coro)
965{
966 coro_unwind_stacks (aTHX);
961 967
962 SvREFCNT_dec (GvSV (PL_defgv)); 968 SvREFCNT_dec (GvSV (PL_defgv));
963 SvREFCNT_dec (GvAV (PL_defgv)); 969 SvREFCNT_dec (GvAV (PL_defgv));
964 SvREFCNT_dec (GvSV (PL_errgv)); 970 SvREFCNT_dec (GvSV (PL_errgv));
965 SvREFCNT_dec (PL_defoutgv); 971 SvREFCNT_dec (PL_defoutgv);
1863 av_push (av_destroy, (SV *)newRV_inc ((SV *)hv)); /* RVinc for perl */ 1869 av_push (av_destroy, (SV *)newRV_inc ((SV *)hv)); /* RVinc for perl */
1864 api_ready (aTHX_ sv_manager); 1870 api_ready (aTHX_ sv_manager);
1865 1871
1866 frame->prepare = prepare_schedule; 1872 frame->prepare = prepare_schedule;
1867 frame->check = slf_check_repeat; 1873 frame->check = slf_check_repeat;
1874
1875 /* as a minor optimisation, we could unwind all stacks here */
1876 /* but that puts extra pressure on pp_slf, and is not worth much */
1877 /*coro_unwind_stacks (aTHX);*/
1868} 1878}
1869 1879
1870/*****************************************************************************/ 1880/*****************************************************************************/
1871/* async pool handler */ 1881/* async pool handler */
1872 1882

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines