Change 27030 by [EMAIL PROTECTED] on 2006/02/01 11:53:04
Subject: [patch] arena rework - unify arenaroots
From: Jim Cromie <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Date: Tue, 31 Jan 2006 03:33:46 -0700
Affected files ...
... //depot/perl/embedvar.h#212 edit
... //depot/perl/hv.c#279 edit
... //depot/perl/intrpvar.h#170 edit
... //depot/perl/perlapi.h#134 edit
... //depot/perl/sv.c#1112 edit
Differences ...
==== //depot/perl/embedvar.h#212 (text+w) ====
Index: perl/embedvar.h
--- perl/embedvar.h#211~26654~ 2006-01-04 09:57:14.000000000 -0800
+++ perl/embedvar.h 2006-02-01 03:53:04.000000000 -0800
@@ -191,7 +191,7 @@
#define PL_beginav (vTHX->Ibeginav)
#define PL_beginav_save (vTHX->Ibeginav_save)
#define PL_bitcount (vTHX->Ibitcount)
-#define PL_body_arenaroots (vTHX->Ibody_arenaroots)
+#define PL_body_arenas (vTHX->Ibody_arenas)
#define PL_body_roots (vTHX->Ibody_roots)
#define PL_bufend (vTHX->Ibufend)
#define PL_bufptr (vTHX->Ibufptr)
@@ -473,7 +473,7 @@
#define PL_Ibeginav PL_beginav
#define PL_Ibeginav_save PL_beginav_save
#define PL_Ibitcount PL_bitcount
-#define PL_Ibody_arenaroots PL_body_arenaroots
+#define PL_Ibody_arenas PL_body_arenas
#define PL_Ibody_roots PL_body_roots
#define PL_Ibufend PL_bufend
#define PL_Ibufptr PL_bufptr
==== //depot/perl/hv.c#279 (text) ====
Index: perl/hv.c
--- perl/hv.c#278~27005~ 2006-01-30 08:29:38.000000000 -0800
+++ perl/hv.c 2006-02-01 03:53:04.000000000 -0800
@@ -43,8 +43,8 @@
HE* he;
HE* heend;
Newx(he, PERL_ARENA_SIZE/sizeof(HE), HE);
- HeNEXT(he) = (HE*) PL_body_arenaroots[HE_SVSLOT];
- PL_body_arenaroots[HE_SVSLOT] = he;
+ HeNEXT(he) = (HE*) PL_body_arenas;
+ PL_body_arenas = he;
heend = &he[PERL_ARENA_SIZE / sizeof(HE) - 1];
PL_body_roots[HE_SVSLOT] = ++he;
==== //depot/perl/intrpvar.h#170 (text) ====
Index: perl/intrpvar.h
--- perl/intrpvar.h#169~26990~ 2006-01-28 16:09:10.000000000 -0800
+++ perl/intrpvar.h 2006-02-01 03:53:04.000000000 -0800
@@ -414,7 +414,7 @@
#endif
PERLVARI(Ibeginav_save, AV*, NULL) /* save BEGIN{}s when compiling */
-PERLVARA(Ibody_arenaroots, SVt_LAST, void*) /* consolidated body-arena
pointers */
+PERLVAR(Ibody_arenas, void*) /* pointer to list of body-arenas */
/* 5.6.0 stopped here */
==== //depot/perl/perlapi.h#134 (text+w) ====
Index: perl/perlapi.h
--- perl/perlapi.h#133~26654~ 2006-01-04 09:57:14.000000000 -0800
+++ perl/perlapi.h 2006-02-01 03:53:04.000000000 -0800
@@ -180,8 +180,8 @@
#define PL_beginav_save (*Perl_Ibeginav_save_ptr(aTHX))
#undef PL_bitcount
#define PL_bitcount (*Perl_Ibitcount_ptr(aTHX))
-#undef PL_body_arenaroots
-#define PL_body_arenaroots (*Perl_Ibody_arenaroots_ptr(aTHX))
+#undef PL_body_arenas
+#define PL_body_arenas (*Perl_Ibody_arenas_ptr(aTHX))
#undef PL_body_roots
#define PL_body_roots (*Perl_Ibody_roots_ptr(aTHX))
#undef PL_bufend
==== //depot/perl/sv.c#1112 (text) ====
Index: perl/sv.c
--- perl/sv.c#1111~26997~ 2006-01-29 16:18:52.000000000 -0800
+++ perl/sv.c 2006-02-01 03:53:04.000000000 -0800
@@ -573,13 +573,6 @@
=cut
*/
-#define free_arena(name) \
- STMT_START { \
- S_free_arena(aTHX_ (void**) PL_ ## name ## _arenaroot); \
- PL_ ## name ## _arenaroot = 0; \
- PL_ ## name ## _root = 0; \
- } STMT_END
-
void
Perl_sv_free_arenas(pTHX)
{
@@ -600,11 +593,10 @@
Safefree(sva);
}
- for (i=0; i<SVt_LAST; i++) {
- S_free_arena(aTHX_ (void**) PL_body_arenaroots[i]);
- PL_body_arenaroots[i] = 0;
+ S_free_arena(aTHX_ (void**) PL_body_arenas);
+
+ for (i=0; i<SVt_LAST; i++)
PL_body_roots[i] = 0;
- }
Safefree(PL_nice_chunk);
PL_nice_chunk = Nullch;
@@ -652,15 +644,14 @@
S_more_bodies (pTHX_ size_t size, svtype sv_type)
{
dVAR;
- void ** const arena_root = &PL_body_arenaroots[sv_type];
- void ** const root = &PL_body_roots[sv_type];
+ void ** const root = &PL_body_roots[sv_type];
char *start;
const char *end;
const size_t count = PERL_ARENA_SIZE / size;
Newx(start, count*size, char);
- *((void **) start) = *arena_root;
- *arena_root = (void *)start;
+ *((void **) start) = PL_body_arenas;
+ PL_body_arenas = (void *)start;
end = start + (count-1) * size;
@@ -10294,7 +10285,7 @@
param->flags = flags;
param->proto_perl = proto_perl;
- Zero(&PL_body_arenaroots, 1, PL_body_arenaroots);
+ PL_body_arenas = NULL;
Zero(&PL_body_roots, 1, PL_body_roots);
PL_nice_chunk = NULL;
End of Patch.