… | |
… | |
811 | |
811 | |
812 | return orig_sigelem_set ? orig_sigelem_set (aTHX_ sv, mg) : 0; |
812 | return orig_sigelem_set ? orig_sigelem_set (aTHX_ sv, mg) : 0; |
813 | } |
813 | } |
814 | |
814 | |
815 | static void |
815 | static void |
816 | prepare_nop (aTHX_ struct coro_transfer_args *ta) |
816 | prepare_nop (pTHX_ struct coro_transfer_args *ta) |
817 | { |
817 | { |
818 | /* kind of mega-hacky, but works */ |
818 | /* kind of mega-hacky, but works */ |
819 | ta->next = ta->prev = (struct coro *)ta; |
819 | ta->next = ta->prev = (struct coro *)ta; |
820 | } |
820 | } |
821 | |
821 | |
822 | static int |
822 | static int |
823 | slf_check_nop (aTHX) |
823 | slf_check_nop (pTHX_ struct CoroSLF *frame) |
824 | { |
824 | { |
825 | return 0; |
825 | return 0; |
826 | } |
826 | } |
827 | |
827 | |
828 | static void |
828 | static void |
… | |
… | |
1320 | dSTACKLEVEL; |
1320 | dSTACKLEVEL; |
1321 | |
1321 | |
1322 | /* sometimes transfer is only called to set idle_sp */ |
1322 | /* sometimes transfer is only called to set idle_sp */ |
1323 | if (expect_false (!next)) |
1323 | if (expect_false (!next)) |
1324 | { |
1324 | { |
1325 | ((coro_cctx *)prev)->idle_sp = stacklevel; |
1325 | ((coro_cctx *)prev)->idle_sp = (void *)stacklevel; |
1326 | assert (((coro_cctx *)prev)->idle_te = PL_top_env); /* just for the side-effect when asserts are enabled */ |
1326 | assert (((coro_cctx *)prev)->idle_te = PL_top_env); /* just for the side-effect when asserts are enabled */ |
1327 | } |
1327 | } |
1328 | else if (expect_true (prev != next)) |
1328 | else if (expect_true (prev != next)) |
1329 | { |
1329 | { |
1330 | coro_cctx *prev__cctx; |
1330 | coro_cctx *prev__cctx; |
… | |
… | |
1357 | |
1357 | |
1358 | prev__cctx = prev->cctx; |
1358 | prev__cctx = prev->cctx; |
1359 | |
1359 | |
1360 | /* possibly untie and reuse the cctx */ |
1360 | /* possibly untie and reuse the cctx */ |
1361 | if (expect_true ( |
1361 | if (expect_true ( |
1362 | prev__cctx->idle_sp == stacklevel |
1362 | prev__cctx->idle_sp == (void *)stacklevel |
1363 | && !(prev__cctx->flags & CC_TRACE) |
1363 | && !(prev__cctx->flags & CC_TRACE) |
1364 | && !force_cctx |
1364 | && !force_cctx |
1365 | )) |
1365 | )) |
1366 | { |
1366 | { |
1367 | /* I assume that stacklevel is a stronger indicator than PL_top_env changes */ |
1367 | /* I assume that stacklevel is a stronger indicator than PL_top_env changes */ |
… | |
… | |
1862 | static void |
1862 | static void |
1863 | slf_prepare_transfer (pTHX_ struct coro_transfer_args *ta) |
1863 | slf_prepare_transfer (pTHX_ struct coro_transfer_args *ta) |
1864 | { |
1864 | { |
1865 | SV **arg = (SV **)slf_frame.data; |
1865 | SV **arg = (SV **)slf_frame.data; |
1866 | |
1866 | |
1867 | prepare_transfer (ta, arg [0], arg [1]); |
1867 | prepare_transfer (aTHX_ ta, arg [0], arg [1]); |
1868 | } |
1868 | } |
1869 | |
1869 | |
1870 | static void |
1870 | static void |
1871 | slf_init_transfer (pTHX_ struct CoroSLF *frame, SV **arg, int items) |
1871 | slf_init_transfer (pTHX_ struct CoroSLF *frame, SV **arg, int items) |
1872 | { |
1872 | { |
… | |
… | |
2642 | MODULE = Coro::State PACKAGE = Coro::AnyEvent |
2642 | MODULE = Coro::State PACKAGE = Coro::AnyEvent |
2643 | |
2643 | |
2644 | BOOT: |
2644 | BOOT: |
2645 | sv_activity = coro_get_sv (aTHX_ "Coro::AnyEvent::ACTIVITY", TRUE); |
2645 | sv_activity = coro_get_sv (aTHX_ "Coro::AnyEvent::ACTIVITY", TRUE); |
2646 | |
2646 | |
2647 | SV * |
2647 | void |
2648 | _schedule (...) |
2648 | _schedule (...) |
2649 | CODE: |
2649 | CODE: |
2650 | { |
2650 | { |
2651 | static int incede; |
2651 | static int incede; |
2652 | |
2652 | |
… | |
… | |
2717 | AvARRAY (av)[0] = AvARRAY (av)[1]; |
2717 | AvARRAY (av)[0] = AvARRAY (av)[1]; |
2718 | AvARRAY (av)[1] = count_sv; |
2718 | AvARRAY (av)[1] = count_sv; |
2719 | cb = av_shift (av); |
2719 | cb = av_shift (av); |
2720 | |
2720 | |
2721 | if (SvOBJECT (cb)) |
2721 | if (SvOBJECT (cb)) |
2722 | api_ready (cb); |
2722 | api_ready (aTHX_ cb); |
2723 | else |
2723 | else |
2724 | croak ("callbacks not yet supported"); |
2724 | croak ("callbacks not yet supported"); |
2725 | |
2725 | |
2726 | SvREFCNT_dec (cb); |
2726 | SvREFCNT_dec (cb); |
2727 | } |
2727 | } |