Steal code from maint, and use PERL_ARENA_ROOTS_SIZE to size the arena
authorNicholas Clark <nick@ccl4.org>
Mon, 20 Feb 2006 20:32:09 +0000 (20:32 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 20 Feb 2006 20:32:09 +0000 (20:32 +0000)
arrays, rather than SVt_LAST, so that SVt_LAST can truthfully remain
the number of genuine SV types, unclouded by implementation details.

p4raw-id: //depot/perl@27251

intrpvar.h
sv.c
sv.h

index 4c63b08..76be01d 100644 (file)
@@ -248,7 +248,7 @@ PERLVAR(Iosname,    char *)         /* operating system */
 
 PERLVAR(Isighandlerp,  Sighandler_t)
 
-PERLVARA(Ibody_roots,  SVt_LAST, void*) /* array of body roots */
+PERLVARA(Ibody_roots,  PERL_ARENA_ROOTS_SIZE, void*) /* array of body roots */
 
 PERLVAR(Inice_chunk,   char *)         /* a nice chunk of memory to reuse */
 PERLVAR(Inice_chunk_size,      U32)    /* how nice the chunk of memory is */
diff --git a/sv.c b/sv.c
index f4e661c..11f79db 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -643,7 +643,7 @@ Perl_sv_free_arenas(pTHX)
     S_free_arena(aTHX_ (void**) PL_body_arenas);
 #endif
 
-    for (i=0; i<SVt_LAST; i++)
+    for (i=0; i<PERL_ARENA_ROOTS_SIZE; i++)
        PL_body_roots[i] = 0;
 
     Safefree(PL_nice_chunk);
diff --git a/sv.h b/sv.h
index 88d3cf8..09a27d5 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -75,6 +75,8 @@ typedef enum {
 #define HE_SVSLOT      SVt_NULL
 #endif
 
+#define PERL_ARENA_ROOTS_SIZE  (SVt_LAST)
+
 /* typedefs to eliminate some typing */
 typedef struct he HE;
 typedef struct hek HEK;