… | |
… | |
709 | tmp.sv_u = a->sv_u; a->sv_u = b->sv_u; b->sv_u = tmp.sv_u; |
709 | tmp.sv_u = a->sv_u; a->sv_u = b->sv_u; b->sv_u = tmp.sv_u; |
710 | |
710 | |
711 | /* if SvANY points to the head, we need to adjust the pointers, |
711 | /* if SvANY points to the head, we need to adjust the pointers, |
712 | * as the pointer for a still points to b, and maybe vice versa. |
712 | * as the pointer for a still points to b, and maybe vice versa. |
713 | */ |
713 | */ |
714 | #define svany_in_head(type) \ |
714 | U32 svany_in_head_set = (1 << SVt_NULL) | (1 << SVt_BIND) | (1 << SVt_IV) | (1 << SVt_RV); |
715 | (((1 << SVt_NULL) | (1 << SVt_BIND) | (1 << SVt_IV) | (1 << SVt_RV)) & (1 << (type))) |
715 | #if NVSIZE <= IVSIZE && PERL_VERSION_ATLEAST(5,20,0) |
|
|
716 | svany_in_head_set |= 1 << SVt_NV; |
|
|
717 | #endif |
|
|
718 | |
|
|
719 | #define svany_in_head(type) (svany_in_head_set & (1 << (type))) |
716 | |
720 | |
717 | if (svany_in_head (SvTYPE (a))) |
721 | if (svany_in_head (SvTYPE (a))) |
718 | SvANY (a) = (void *)((PTRV)SvANY (a) - (PTRV)b + (PTRV)a); |
722 | SvANY (a) = (void *)((PTRV)SvANY (a) - (PTRV)b + (PTRV)a); |
719 | |
723 | |
720 | if (svany_in_head (SvTYPE (b))) |
724 | if (svany_in_head (SvTYPE (b))) |
… | |
… | |
3939 | |
3943 | |
3940 | MODULE = Coro::State PACKAGE = Coro |
3944 | MODULE = Coro::State PACKAGE = Coro |
3941 | |
3945 | |
3942 | BOOT: |
3946 | BOOT: |
3943 | { |
3947 | { |
|
|
3948 | if (SVt_LAST > 32) |
|
|
3949 | croak ("Coro internal error: SVt_LAST > 32, swap_sv might need adjustment"); |
|
|
3950 | |
3944 | sv_pool_rss = coro_get_sv (aTHX_ "Coro::POOL_RSS" , TRUE); |
3951 | sv_pool_rss = coro_get_sv (aTHX_ "Coro::POOL_RSS" , TRUE); |
3945 | sv_pool_size = coro_get_sv (aTHX_ "Coro::POOL_SIZE" , TRUE); |
3952 | sv_pool_size = coro_get_sv (aTHX_ "Coro::POOL_SIZE" , TRUE); |
3946 | cv_coro_run = get_cv ( "Coro::_coro_run" , GV_ADD); |
3953 | cv_coro_run = get_cv ( "Coro::_coro_run" , GV_ADD); |
3947 | coro_current = coro_get_sv (aTHX_ "Coro::current" , FALSE); SvREADONLY_on (coro_current); |
3954 | coro_current = coro_get_sv (aTHX_ "Coro::current" , FALSE); SvREADONLY_on (coro_current); |
3948 | av_async_pool = coro_get_av (aTHX_ "Coro::async_pool", TRUE); |
3955 | av_async_pool = coro_get_av (aTHX_ "Coro::async_pool", TRUE); |