summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1999-05-24 13:43:56 -0400
committerGurusamy Sarathy <gsar@cpan.org>1999-05-25 06:03:27 +0000
commite094bb4e86c3cb9e46442b6003185dc746deb691 (patch)
treec3e81e1d22441cd2ace41f6b2bbd884bb01767ee /hv.c
parent7e4e29cd2f4cb273fa387b32ac03e06565aacd03 (diff)
downloadperl-e094bb4e86c3cb9e46442b6003185dc746deb691.tar.gz
hv.c calling negative malloc()
Message-ID: <19990524174356.A1944@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@3470
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hv.c b/hv.c
index d21af5c4c7..0c472bcda5 100644
--- a/hv.c
+++ b/hv.c
@@ -26,7 +26,9 @@ static HEK *save_hek _((const char *str, I32 len, U32 hash));
# define ARRAY_ALLOC_BYTES(size) ( (size)*sizeof(HE*) )
#else
# define MALLOC_OVERHEAD 16
-# define ARRAY_ALLOC_BYTES(size) ( (size)*sizeof(HE*)*2 - MALLOC_OVERHEAD )
+# define ARRAY_ALLOC_BYTES(size) ( ((size) < 64) \
+ ? (size)*sizeof(HE*) \
+ : (size)*sizeof(HE*)*2 - MALLOC_OVERHEAD )
#endif
STATIC HE*