summaryrefslogtreecommitdiffstats
path: root/src/H5HG.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-05-29 20:02:34 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-05-29 20:02:34 (GMT)
commitbdcbada3f282774f709e17990dc7f77b24919950 (patch)
treef2f1264f0a3c7ac08b78eb314358ce1ee62aa5a5 /src/H5HG.c
parent7b0fa3950e74ea0c9bfe3baa07a48e2d451ebab5 (diff)
downloadhdf5-bdcbada3f282774f709e17990dc7f77b24919950.zip
hdf5-bdcbada3f282774f709e17990dc7f77b24919950.tar.gz
hdf5-bdcbada3f282774f709e17990dc7f77b24919950.tar.bz2
[svn-r13814] Description:
Change back to clearing memory buffers by default, but give users option to disable this, for performance reasons (--disable-clear-file-buffers). Also, add configure option (--enable-using-memchecker) to conveniently control making the library "play nice" with memory checking tools like valgrind and purify. Tested on: Mac OS X/32 10.4.9 (amazon) FreeBSD/32 6.2 (duty) Linux/32 2.6 (kagiso)
Diffstat (limited to 'src/H5HG.c')
-rw-r--r--src/H5HG.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/H5HG.c b/src/H5HG.c
index a2b6780..0ff9249 100644
--- a/src/H5HG.c
+++ b/src/H5HG.c
@@ -223,9 +223,9 @@ H5HG_create (H5F_t *f, hid_t dxpl_id, size_t size)
if (NULL==(heap->chunk = H5FL_BLK_MALLOC (heap_chunk,size)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, \
"memory allocation failed");
-#ifdef H5_USING_PURIFY
-HDmemset(heap->chunk,0,size);
-#endif /* H5_USING_PURIFY */
+#ifdef H5_CLEAR_MEMORY
+HDmemset(heap->chunk, 0, size);
+#endif /* H5_CLEAR_MEMORY */
heap->nalloc = H5HG_NOBJS (f, size);
heap->nused = 1; /* account for index 0, which is used for the free object */
if (NULL==(heap->obj = H5FL_SEQ_MALLOC (H5HG_obj_t,heap->nalloc)))
@@ -845,9 +845,9 @@ H5HG_extend (H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned * heap_flags_ptr
/* Re-allocate the heap information in memory */
if (NULL==(new_chunk = H5FL_BLK_REALLOC (heap_chunk, heap->chunk, heap->size+need)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "new heap allocation failed");
-#ifdef H5_USING_PURIFY
-HDmemset(new_chunk+heap->size,0,need);
-#endif /* H5_USING_PURIFY */
+#ifdef H5_CLEAR_MEMORY
+HDmemset(new_chunk + heap->size, 0, need);
+#endif /* H5_CLEAR_MEMORY */
/* Adjust the size of the heap */
old_size=heap->size;