… | |
… | |
1666 | #define TRANSFER(ta, force_cctx) transfer (aTHX_ (ta).prev, (ta).next, (force_cctx)) |
1666 | #define TRANSFER(ta, force_cctx) transfer (aTHX_ (ta).prev, (ta).next, (force_cctx)) |
1667 | #define TRANSFER_CHECK(ta) transfer_check (aTHX_ (ta).prev, (ta).next) |
1667 | #define TRANSFER_CHECK(ta) transfer_check (aTHX_ (ta).prev, (ta).next) |
1668 | |
1668 | |
1669 | /** high level stuff ********************************************************/ |
1669 | /** high level stuff ********************************************************/ |
1670 | |
1670 | |
1671 | static int |
1671 | static void |
1672 | coro_state_destroy (pTHX_ struct coro *coro) |
1672 | coro_state_destroy (pTHX_ struct coro *coro) |
1673 | { |
1673 | { |
1674 | if (coro->flags & CF_DESTROYED) |
1674 | if (coro->flags & CF_DESTROYED) |
1675 | return 0; |
1675 | return; |
1676 | |
1676 | |
|
|
1677 | /* this callback is reserved for slf functions needing to do cleanup */ |
1677 | if (coro->on_destroy && !PL_dirty) |
1678 | if (coro->on_destroy && !PL_dirty) |
1678 | coro->on_destroy (aTHX_ coro); |
1679 | coro->on_destroy (aTHX_ coro); |
1679 | |
1680 | |
1680 | /* |
1681 | /* |
1681 | * The on_destroy above most likely is from an SLF call. |
1682 | * The on_destroy above most likely is from an SLF call. |
… | |
… | |
1709 | cctx_destroy (coro->cctx); |
1710 | cctx_destroy (coro->cctx); |
1710 | SvREFCNT_dec (coro->startcv); |
1711 | SvREFCNT_dec (coro->startcv); |
1711 | SvREFCNT_dec (coro->args); |
1712 | SvREFCNT_dec (coro->args); |
1712 | SvREFCNT_dec (coro->swap_sv); |
1713 | SvREFCNT_dec (coro->swap_sv); |
1713 | SvREFCNT_dec (CORO_THROW); |
1714 | SvREFCNT_dec (CORO_THROW); |
1714 | |
|
|
1715 | return 1; |
|
|
1716 | } |
1715 | } |
1717 | |
1716 | |
1718 | static int |
1717 | static int |
1719 | coro_state_free (pTHX_ SV *sv, MAGIC *mg) |
1718 | coro_state_free (pTHX_ SV *sv, MAGIC *mg) |
1720 | { |
1719 | { |