summaryrefslogtreecommitdiff
path: root/av.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-02-26 23:22:30 +0000
committerNicholas Clark <nick@ccl4.org>2008-02-26 23:22:30 +0000
commitca7c1a2998b2bece800791e0ee5cce600e2f647a (patch)
treebf96c040e0b720173dd3d840b315602cdd04f92a /av.c
parent5d487c263b0c0c7fb6c50dee3540f1838c4ab067 (diff)
downloadperl-ca7c1a2998b2bece800791e0ee5cce600e2f647a.tar.gz
If the C library provides malloc_size(), we can use that in the same
places as Perl's malloced_size(), except that we need to be careful of any PERL_TRACK_MEMPOOL manipulations in force. Wrap both as Perl_safesysmalloc_size(), to give a consistent name and interface. p4raw-id: //depot/perl@33379
Diffstat (limited to 'av.c')
-rw-r--r--av.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/av.c b/av.c
index cf95d6164a..4b3b08d9e3 100644
--- a/av.c
+++ b/av.c
@@ -117,8 +117,9 @@ Perl_av_extend(pTHX_ AV *av, I32 key)
IV itmp;
#endif
-#ifdef MYMALLOC
- newmax = malloced_size((void*)AvALLOC(av))/sizeof(SV*) - 1;
+#ifdef Perl_safesysmalloc_size
+ newmax = Perl_safesysmalloc_size((void*)AvALLOC(av)) /
+ sizeof(SV*) - 1;
if (key <= newmax)
goto resized;
@@ -147,7 +148,7 @@ Perl_av_extend(pTHX_ AV *av, I32 key)
Safefree(AvALLOC(av));
AvALLOC(av) = ary;
#endif
-#ifdef MYMALLOC
+#ifdef Perl_safesysmalloc_size
resized:
#endif
ary = AvALLOC(av) + AvMAX(av) + 1;