diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-08-20 15:31:42 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-08-20 17:34:39 +0100 |
commit | 1e30fcd5eb66123dc2adb29941506280426aefaf (patch) | |
tree | d378d52daafa08bea562d175532be388a310f7a4 /hv.c | |
parent | 029821316c3d1268a765152507ac4ffb64746558 (diff) | |
download | perl-1e30fcd5eb66123dc2adb29941506280426aefaf.tar.gz |
Expose more_bodies(), and use it to replace S_more_he().
Convert get_arena() to be static, as now its only user is Perl_more_bodies().
Perl_get_arena() was not in the public API, and neither Google codesearch
nor an upacked CPAN show anything to be using it.
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 20 |
1 files changed, 1 insertions, 19 deletions
@@ -40,24 +40,6 @@ holds the key and hash value. static const char S_strtab_error[] = "Cannot modify shared string table in hv_%s"; -STATIC void -S_more_he(pTHX) -{ - dVAR; - /* We could generate this at compile time via (another) auxiliary C - program? */ - const size_t arena_size = Perl_malloc_good_size(PERL_ARENA_SIZE); - HE* he = (HE*) Perl_get_arena(aTHX_ arena_size, HE_SVSLOT); - HE * const heend = &he[arena_size / sizeof(HE) - 1]; - - PL_body_roots[HE_SVSLOT] = he; - while (he < heend) { - HeNEXT(he) = (HE*)(he + 1); - he++; - } - HeNEXT(he) = 0; -} - #ifdef PURIFY #define new_HE() (HE*)safemalloc(sizeof(HE)) @@ -73,7 +55,7 @@ S_new_he(pTHX) void ** const root = &PL_body_roots[HE_SVSLOT]; if (!*root) - S_more_he(aTHX); + Perl_more_bodies(aTHX_ HE_SVSLOT, sizeof(HE), PERL_ARENA_SIZE); he = (HE*) *root; assert(he); *root = HeNEXT(he); |