Describe __PACKAGE__ in perldelta
[p5sagit/p5-mst-13.2.git] / scope.c
diff --git a/scope.c b/scope.c
index 3ca31aa..f7835b7 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -1,6 +1,6 @@
 /*    scope.c
  *
- *    Copyright (c) 1991-1994, Larry Wall
+ *    Copyright (c) 1991-1997, Larry Wall
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
 #include "EXTERN.h"
 #include "perl.h"
 
-/*
- * This value determines how small an SV is "small enough" to keep
- * in a lexical variable in anticipation of the next invocation.
- */
-#define PADVAL_SMALL_ENOUGH 240
-
 SV**
 stack_grow(sp, p, n)
 SV** sp;
@@ -179,14 +173,13 @@ I32 empty;
     if (empty) {
        register GP *gp;
        Newz(602, gp, 1, GP);
-       GvGP(gv) = gp;
-       GvREFCNT(gv) = 1;
+       GvGP(gv) = gp_ref(gp);
        GvSV(gv) = NEWSV(72,0);
        GvLINE(gv) = curcop->cop_line;
        GvEGV(gv) = gv;
     }
     else {
-       GvGP(gv)->gp_refcnt++;
+       gp_ref(GvGP(gv));
        GvINTRO_on(gv);
     }
 }
@@ -532,7 +525,8 @@ I32 base;
            break;
        case SAVEt_FREEOP:
            ptr = SSPOPPTR;
-           curpad = AvARRAY(comppad);
+           if (comppad)
+               curpad = AvARRAY(comppad);
            op_free((OP*)ptr);
            break;
        case SAVEt_FREEPV:
@@ -556,16 +550,10 @@ I32 base;
                case SVt_NULL:
                    break;
                case SVt_PVAV:
-                   if (AvMAX(sv) < (PADVAL_SMALL_ENOUGH / sizeof(SV*)))
-                       av_clear((AV*)sv);
-                   else
-                       av_undef((AV*)sv);
+                   av_clear((AV*)sv);
                    break;
                case SVt_PVHV:
-                   if (HvMAX(sv) < (PADVAL_SMALL_ENOUGH / sizeof(SV*)))
-                       hv_clear((HV*)sv);
-                   else
-                       hv_undef((HV*)sv);
+                   hv_clear((HV*)sv);
                    break;
                case SVt_PVCV:
                    croak("panic: leave_scope pad code");
@@ -577,12 +565,6 @@ I32 base;
                default:
                    (void)SvOK_off(sv);
                    (void)SvOOK_off(sv);
-                   if (SvPVX(sv) && SvLEN(sv) > PADVAL_SMALL_ENOUGH) {
-                       Safefree(SvPVX(sv));
-                       SvPVX(sv) = Nullch;
-                       SvLEN(sv) = 0;
-                       SvCUR(sv) = 0;
-                   }
                    break;
                }
            }