This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Default to allocating the correct size for the array in the HV.
authorNicholas Clark <nick@ccl4.org>
Wed, 18 May 2005 12:34:53 +0000 (12:34 +0000)
committerNicholas Clark <nick@ccl4.org>
Wed, 18 May 2005 12:34:53 +0000 (12:34 +0000)
Override this with -DPERL_USE_LARGE_HV_ALLOC

p4raw-id: //depot/perl@24497

hv.h

diff --git a/hv.h b/hv.h
index 963317e..e39e4bf 100644 (file)
--- a/hv.h
+++ b/hv.h
@@ -305,7 +305,10 @@ C<SV*>.
 #define HEK_REHASH_on(hek)     (HEK_FLAGS(hek) |= HVhek_REHASH)
 
 /* calculate HV array allocation */
-#if defined(STRANGE_MALLOC) || defined(MYMALLOC)
+#ifndef PERL_USE_LARGE_HV_ALLOC
+/* Default to allocating the correct size - default to assuming that malloc()
+   is not broken and is efficient at allocating blocks sized at powers-of-two.
+*/   
 #  define PERL_HV_ARRAY_ALLOC_BYTES(size) ((size) * sizeof(HE*))
 #else
 #  define MALLOC_OVERHEAD 16