… | |
… | |
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 | |
942 | static void |
942 | static void |
943 | coro_destruct_perl (pTHX_ struct coro *coro) |
943 | coro_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 | |
|
|
963 | static void |
|
|
964 | coro_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 | |