From 704f31c15174d0e313cad7b978dd7f01281bda7a Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 17 Jan 2002 09:48:28 -0500 Subject: [svn-r4841] Purpose: Code improvement Description: Take advantage of the "MALLOC_WORKS" flag to not force malloced memory pieces to be at least 1 byte when the malloc implementation allows malloc(0) to work. Platforms tested: FreeBSD 4.5 (sleipnir) & Cray SV1 (killeen) --- src/H5MMprivate.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/H5MMprivate.h b/src/H5MMprivate.h index 620efda..b37a4a3 100644 --- a/src/H5MMprivate.h +++ b/src/H5MMprivate.h @@ -22,8 +22,13 @@ /* Private headers needed by this file */ #include "H5private.h" +#ifdef H5_MALLOC_WORKS +#define H5MM_malloc(Z) HDmalloc(Z) +#define H5MM_calloc(Z) HDcalloc(1,Z) +#else /* H5_MALLOC_WORKS */ #define H5MM_malloc(Z) HDmalloc(MAX(1,Z)) #define H5MM_calloc(Z) HDcalloc(1,MAX(1,Z)) +#endif /* H5_MALLOC_WORKS */ /* * Library prototypes... -- cgit v0.12