… | |
… | |
967 | #endif |
967 | #endif |
968 | |
968 | |
969 | /* |
969 | /* |
970 | * This overrides the default magic get method of %SIG elements. |
970 | * This overrides the default magic get method of %SIG elements. |
971 | * The original one doesn't provide for reading back of PL_diehook/PL_warnhook |
971 | * The original one doesn't provide for reading back of PL_diehook/PL_warnhook |
972 | * and instead of trying to save and restore the hash elements, we just provide |
972 | * and instead of trying to save and restore the hash elements (extremely slow), |
973 | * readback here. |
973 | * we just provide our own readback here. |
974 | */ |
974 | */ |
975 | static int |
975 | static int |
976 | coro_sigelem_get (pTHX_ SV *sv, MAGIC *mg) |
976 | coro_sigelem_get (pTHX_ SV *sv, MAGIC *mg) |
977 | { |
977 | { |
978 | const char *s = MgPV_nolen_const (mg); |
978 | const char *s = MgPV_nolen_const (mg); |
… | |
… | |
1086 | PL_parser = 0; |
1086 | PL_parser = 0; |
1087 | #endif |
1087 | #endif |
1088 | PL_hints = 0; |
1088 | PL_hints = 0; |
1089 | |
1089 | |
1090 | /* recreate the die/warn hooks */ |
1090 | /* recreate the die/warn hooks */ |
1091 | PL_diehook = 0; SvSetMagicSV (*hv_fetch (hv_sig, "__DIE__" , sizeof ("__DIE__" ) - 1, 1), rv_diehook ); |
1091 | PL_diehook = SvREFCNT_inc (rv_diehook); |
1092 | PL_warnhook = 0; SvSetMagicSV (*hv_fetch (hv_sig, "__WARN__", sizeof ("__WARN__") - 1, 1), rv_warnhook); |
1092 | PL_warnhook = SvREFCNT_inc (rv_warnhook); |
1093 | |
1093 | |
1094 | GvSV (PL_defgv) = newSV (0); |
1094 | GvSV (PL_defgv) = newSV (0); |
1095 | GvAV (PL_defgv) = coro->args; coro->args = 0; |
1095 | GvAV (PL_defgv) = coro->args; coro->args = 0; |
1096 | GvSV (PL_errgv) = newSV (0); |
1096 | GvSV (PL_errgv) = newSV (0); |
1097 | GvSV (irsgv) = newSVpvn ("\n", 1); sv_magic (GvSV (irsgv), (SV *)irsgv, PERL_MAGIC_sv, "/", 0); |
1097 | GvSV (irsgv) = newSVpvn ("\n", 1); sv_magic (GvSV (irsgv), (SV *)irsgv, PERL_MAGIC_sv, "/", 0); |