if (strEQ(name2, "IG")) {
HV *hv;
I32 i;
- if (!PL_psig_ptr) {
- Newxz(PL_psig_ptr, SIG_SIZE, SV*);
- Newxz(PL_psig_name, SIG_SIZE, SV*);
+ if (!PL_psig_name) {
+ Newxz(PL_psig_name, 2 * SIG_SIZE, SV*);
Newxz(PL_psig_pend, SIG_SIZE, int);
+ PL_psig_ptr = PL_psig_name + SIG_SIZE;
} else {
/* I think that the only way to get here is to re-use an
embedded perl interpreter, where the previous
interpreter structure that something else will crash
before we get here. I suspect that this is one of
those "doctor, it hurts when I do this" bugs. */
- Zero(PL_psig_ptr, SIG_SIZE, SV*);
- Zero(PL_psig_name, SIG_SIZE, SV*);
+ Zero(PL_psig_name, 2 * SIG_SIZE, SV*);
Zero(PL_psig_pend, SIG_SIZE, int);
}
GvMULTI_on(gv);
signal handler dispatches. */
PERLVAR(Ipsig_ptr, SV**)
/* Array of names of signals, indexed by signal number, for (re)use as the first
- argument to a signal handler. */
+ argument to a signal handler. Only one block of memory is allocated for
+ both psig_name and psig_ptr. */
PERLVAR(Ipsig_name, SV**)
#if defined(PERL_IMPLICIT_SYS)
Safefree(PL_reg_poscache);
free_tied_hv_pool();
Safefree(PL_op_mask);
- Safefree(PL_psig_ptr);
- PL_psig_ptr = (SV**)NULL;
Safefree(PL_psig_name);
PL_psig_name = (SV**)NULL;
+ PL_psig_ptr = (SV**)NULL;
Safefree(PL_psig_pend);
PL_psig_pend = (int*)NULL;
PL_formfeed = NULL;
PL_psig_pend = (int*)NULL;
}
- if (proto_perl->Ipsig_ptr) {
- Newx(PL_psig_ptr, SIG_SIZE, SV*);
- Newx(PL_psig_name, SIG_SIZE, SV*);
- sv_dup_inc_multiple(proto_perl->Ipsig_ptr, PL_psig_ptr, SIG_SIZE,
- param);
- sv_dup_inc_multiple(proto_perl->Ipsig_name, PL_psig_name, SIG_SIZE,
+ if (proto_perl->Ipsig_name) {
+ Newx(PL_psig_name, 2 * SIG_SIZE, SV*);
+ sv_dup_inc_multiple(proto_perl->Ipsig_name, PL_psig_name, 2 * SIG_SIZE,
param);
+ PL_psig_ptr = PL_psig_name + SIG_SIZE;
}
else {
PL_psig_ptr = (SV**)NULL;