… | |
… | |
133 | #else |
133 | #else |
134 | # define dSTACKLEVEL volatile void *stacklevel |
134 | # define dSTACKLEVEL volatile void *stacklevel |
135 | # define STACKLEVEL ((void *)&stacklevel) |
135 | # define STACKLEVEL ((void *)&stacklevel) |
136 | #endif |
136 | #endif |
137 | |
137 | |
138 | #define IN_DESTRUCT (PL_main_cv == Nullcv) |
138 | #define IN_DESTRUCT PL_dirty |
139 | |
139 | |
140 | #if __GNUC__ >= 3 |
140 | #if __GNUC__ >= 3 |
141 | # define attribute(x) __attribute__(x) |
141 | # define attribute(x) __attribute__(x) |
142 | # define expect(expr,value) __builtin_expect ((expr),(value)) |
142 | # define expect(expr,value) __builtin_expect ((expr),(value)) |
143 | # define INLINE static inline |
143 | # define INLINE static inline |
… | |
… | |
381 | |
381 | |
382 | static void |
382 | static void |
383 | free_padlist (pTHX_ AV *padlist) |
383 | free_padlist (pTHX_ AV *padlist) |
384 | { |
384 | { |
385 | /* may be during global destruction */ |
385 | /* may be during global destruction */ |
386 | if (SvREFCNT (padlist)) |
386 | if (!IN_DESTRUCT) |
387 | { |
387 | { |
388 | I32 i = AvFILLp (padlist); |
388 | I32 i = AvFILLp (padlist); |
|
|
389 | |
389 | while (i >= 0) |
390 | while (i >= 0) |
390 | { |
391 | { |
|
|
392 | /* we try to be extra-careful here */ |
391 | SV **svp = AvARRAY (padlist)[i--]; |
393 | AV *av = (AV *)AvARRAY (padlist)[i--]; |
392 | if (svp) |
394 | |
393 | { |
395 | I32 i = AvFILLp (av); |
394 | AvREAL_on (*svp); |
396 | |
395 | av_undef (*svp); |
397 | while (i >= 0) |
|
|
398 | SvREFCNT_dec (AvARRAY (av)[i--]); |
|
|
399 | |
|
|
400 | AvFILLp (av) = -1; |
396 | SvREFCNT_dec (*svp); |
401 | SvREFCNT_dec (av); |
397 | } |
|
|
398 | } |
402 | } |
399 | |
403 | |
|
|
404 | AvFILLp (padlist) = -1; |
400 | SvREFCNT_dec ((SV*)padlist); |
405 | SvREFCNT_dec ((SV*)padlist); |
401 | } |
406 | } |
402 | } |
407 | } |
403 | |
408 | |
404 | static int |
409 | static int |