This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
As Perl_get_arena() is dealing with sizes, use size_t rather than int,
authorNicholas Clark <nick@ccl4.org>
Fri, 19 Jan 2007 00:13:02 +0000 (00:13 +0000)
committerNicholas Clark <nick@ccl4.org>
Fri, 19 Jan 2007 00:13:02 +0000 (00:13 +0000)
as it's both unsigned and semantically the correct width for a size.
As all arenas get cleared later on, can use Newx() rather than Newxz().

p4raw-id: //depot/perl@29879

embed.fnc
proto.h
sv.c

index 91bb0a5..f544e5b 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1106,7 +1106,7 @@ s |HV*    |require_tie_mod|NN GV *gv|NN const char *varpv|NN SV* namesv \
 #endif
 
 : #if defined(PERL_IN_HV_C) || defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
-paRxo  |void*  |get_arena      |int svtype
+paRxo  |void*  |get_arena      |size_t svtype
 : #endif
 
 #if defined(PERL_IN_HV_C) || defined(PERL_DECL_PROT)
diff --git a/proto.h b/proto.h
index 4465055..e0d2fc4 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -2958,7 +2958,7 @@ STATIC HV*        S_require_tie_mod(pTHX_ GV *gv, const char *varpv, SV* namesv, const
 
 #endif
 
-PERL_CALLCONV void*    Perl_get_arena(pTHX_ int svtype)
+PERL_CALLCONV void*    Perl_get_arena(pTHX_ size_t svtype)
                        __attribute__malloc__
                        __attribute__warn_unused_result__;
 
diff --git a/sv.c b/sv.c
index 98f2f81..ac5eeb0 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -679,7 +679,7 @@ Perl_sv_free_arenas(pTHX)
    TBD: export properly for hv.c: S_more_he().
 */
 void*
-Perl_get_arena(pTHX_ int arena_size)
+Perl_get_arena(pTHX_ size_t arena_size)
 {
     dVAR;
     struct arena_desc* adesc;
@@ -704,7 +704,7 @@ Perl_get_arena(pTHX_ int arena_size)
     adesc = &((*aroot)->set[curr]);
     assert(!adesc->arena);
     
-    Newxz(adesc->arena, arena_size, char);
+    Newx(adesc->arena, arena_size, char);
     adesc->size = arena_size;
     DEBUG_m(PerlIO_printf(Perl_debug_log, "arena %d added: %p size %d\n", 
                          curr, (void*)adesc->arena, arena_size));