summaryrefslogtreecommitdiffstats
path: root/src/H5MMprivate.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-01-17 14:48:28 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-01-17 14:48:28 (GMT)
commit704f31c15174d0e313cad7b978dd7f01281bda7a (patch)
tree2cc5ce5207eb792a3cdb71a3716a8b020917b2f8 /src/H5MMprivate.h
parent7758f790c9320b0269848afb760f7c2b32a3d7a3 (diff)
downloadhdf5-704f31c15174d0e313cad7b978dd7f01281bda7a.zip
hdf5-704f31c15174d0e313cad7b978dd7f01281bda7a.tar.gz
hdf5-704f31c15174d0e313cad7b978dd7f01281bda7a.tar.bz2
[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)
Diffstat (limited to 'src/H5MMprivate.h')
-rw-r--r--src/H5MMprivate.h5
1 files changed, 5 insertions, 0 deletions
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...