From: Ilya Zakharevich Date: Mon, 24 May 1999 17:43:56 +0000 (-0400) Subject: hv.c calling negative malloc() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e094bb4e86c3cb9e46442b6003185dc746deb691;p=p5sagit%2Fp5-mst-13.2.git hv.c calling negative malloc() Message-ID: <19990524174356.A1944@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@3470 --- diff --git a/hv.c b/hv.c index d21af5c..0c472bc 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*