summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2016-01-29 13:51:29 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2016-01-29 13:51:29 (GMT)
commit61ab7b8bf3f15e31728ed5d4274a4e826f76ff7a (patch)
treeec8d1f78ce20288e0151cda3393561ed34215329 /src
parent821ce6874d9e2b322dda171f95901d5f68a1c26a (diff)
downloadhdf5-61ab7b8bf3f15e31728ed5d4274a4e826f76ff7a.zip
hdf5-61ab7b8bf3f15e31728ed5d4274a4e826f76ff7a.tar.gz
hdf5-61ab7b8bf3f15e31728ed5d4274a4e826f76ff7a.tar.bz2
[svn-r29016] Merge of r28936, 28949, 28960-29009 from trunk.
Tested on: 64-bit Ubuntu 15.10 (Linux 4.2.0 x86_64) gcc 5.2.1 autotools serial w/ Fortran and C++ autotools parallel (MPICH 3.1.4) w/ Fortran CMake serial (3.3.2, via cmakehdf5)
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/H5.c133
-rw-r--r--src/H5B.c11
-rw-r--r--src/H5B2cache.c4
-rw-r--r--src/H5B2hdr.c4
-rw-r--r--src/H5B2int.c22
-rw-r--r--src/H5Bcache.c2
-rw-r--r--src/H5Dcontig.c7
-rw-r--r--src/H5FDcore.c4
-rw-r--r--src/H5Faccum.c35
-rw-r--r--src/H5Gcache.c2
-rw-r--r--src/H5Gprivate.h7
-rw-r--r--src/H5HFdblock.c4
-rw-r--r--src/H5HFtiny.c5
-rw-r--r--src/H5HG.c16
-rw-r--r--src/H5HLcache.c2
-rw-r--r--src/H5MFprivate.h9
-rw-r--r--src/H5Pdcpl.c14
-rw-r--r--src/H5SMcache.c3
-rw-r--r--src/H5STprivate.h4
-rw-r--r--src/H5Zscaleoffset.c4
-rw-r--r--src/libhdf5.settings.in71
22 files changed, 165 insertions, 202 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0fbd32b..ca71fca 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -868,11 +868,11 @@ set_target_properties (${HDF5_LIB_TARGET} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
-option (HDF5_ENABLE_DEBUG_APIS "Turn on debugging in all packages" OFF)
+option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF)
if (HDF5_ENABLE_DEBUG_APIS)
set_target_properties (${HDF5_LIB_TARGET} PROPERTIES
COMPILE_DEFINITIONS
- "H5Z_DEBUG;H5VM_DEBUG;H5T_DEBUG;H5S_DEBUG;H5P_DEBUG;H5O_DEBUG;H5MM_DEBUG;H5MF_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5HG_DEBUG;H5G_DEBUG;H5F_DEBUG;H5E_DEBUG;H5D_DEBUG;H5B_DEBUG;H5AC_DEBUG"
+ "H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5B_DEBUG;H5AC_DEBUG"
)
endif (HDF5_ENABLE_DEBUG_APIS)
set (install_targets ${HDF5_LIB_TARGET})
diff --git a/src/H5.c b/src/H5.c
index a522398..4de5731 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -552,30 +552,29 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5_debug_mask
+ * Function: H5_debug_mask
*
- * Purpose: Set runtime debugging flags according to the string S. The
- * string should contain file numbers and package names
- * separated by other characters. A file number applies to all
- * following package names up to the next file number. The
- * initial file number is `2' (the standard error stream). Each
- * package name can be preceded by a `+' or `-' to add or remove
- * the package from the debugging list (`+' is the default). The
- * special name `all' means all packages.
+ * Purpose: Set runtime debugging flags according to the string S. The
+ * string should contain file numbers and package names
+ * separated by other characters. A file number applies to all
+ * following package names up to the next file number. The
+ * initial file number is `2' (the standard error stream). Each
+ * package name can be preceded by a `+' or `-' to add or remove
+ * the package from the debugging list (`+' is the default). The
+ * special name `all' means all packages.
*
- * The name `trace' indicates that API tracing is to be turned
- * on or off.
+ * The name `trace' indicates that API tracing is to be turned
+ * on or off.
*
- * Return: void
+ * The name 'ttop' indicates that only top-level API calls
+ * should be shown. This also turns on tracing as if the
+ * 'trace' word was shown.
*
- * Programmer: Robb Matzke
+ * Return: void
+ *
+ * Programmer: Robb Matzke
* Wednesday, August 19, 1998
*
- * Modifications:
- * Robb Matzke, 2002-08-08
- * Accepts the `ttop' word. If enabled then show only the
- * top level API calls, otherwise show all API calls. Also
- * turns on tracing as if the `trace' word was present.
*-------------------------------------------------------------------------
*/
static void
@@ -587,55 +586,57 @@ H5_debug_mask(const char *s)
hbool_t clear;
while (s && *s) {
- if (HDisalpha(*s) || '-'==*s || '+'==*s) {
- /* Enable or Disable debugging? */
- if ('-'==*s) {
- clear = TRUE;
- s++;
- } else if ('+'==*s) {
- clear = FALSE;
- s++;
- } else {
- clear = FALSE;
- }
-
- /* Get the name */
- for (i=0; HDisalpha(*s); i++, s++)
- if (i<sizeof pkg_name)
+
+ if (HDisalpha(*s) || '-'==*s || '+'==*s) {
+
+ /* Enable or Disable debugging? */
+ if ('-'==*s) {
+ clear = TRUE;
+ s++;
+ } else if ('+'==*s) {
+ clear = FALSE;
+ s++;
+ } else {
+ clear = FALSE;
+ } /* end if */
+
+ /* Get the name */
+ for (i=0; HDisalpha(*s); i++, s++)
+ if (i<sizeof pkg_name)
pkg_name[i] = *s;
- pkg_name[MIN(sizeof(pkg_name)-1, i)] = '\0';
+ pkg_name[MIN(sizeof(pkg_name)-1, i)] = '\0';
- /* Trace, all, or one? */
- if (!HDstrcmp(pkg_name, "trace")) {
- H5_debug_g.trace = clear ? NULL : stream;
+ /* Trace, all, or one? */
+ if (!HDstrcmp(pkg_name, "trace")) {
+ H5_debug_g.trace = clear ? NULL : stream;
} else if (!HDstrcmp(pkg_name, "ttop")) {
H5_debug_g.trace = stream;
H5_debug_g.ttop = (hbool_t)!clear;
} else if (!HDstrcmp(pkg_name, "ttimes")) {
H5_debug_g.trace = stream;
H5_debug_g.ttimes = (hbool_t)!clear;
- } else if (!HDstrcmp(pkg_name, "all")) {
- for (i=0; i<(size_t)H5_NPKGS; i++)
- H5_debug_g.pkg[i].stream = clear ? NULL : stream;
- } else {
- for (i=0; i<(size_t)H5_NPKGS; i++) {
- if (!HDstrcmp(H5_debug_g.pkg[i].name, pkg_name)) {
- H5_debug_g.pkg[i].stream = clear ? NULL : stream;
- break;
- }
- }
- if (i>=(size_t)H5_NPKGS)
- fprintf(stderr, "HDF5_DEBUG: ignored %s\n", pkg_name);
- }
-
- } else if (HDisdigit(*s)) {
- int fd = (int)HDstrtol(s, &rest, 0);
- H5_debug_open_stream_t *open_stream;
-
- if((stream = HDfdopen(fd, "w")) != NULL) {
- (void)HDsetvbuf(stream, NULL, _IOLBF, (size_t)0);
-
- if(NULL == (open_stream = (H5_debug_open_stream_t *)H5MM_malloc(sizeof(H5_debug_open_stream_t)))) {
+ } else if (!HDstrcmp(pkg_name, "all")) {
+ for (i=0; i<(size_t)H5_NPKGS; i++)
+ H5_debug_g.pkg[i].stream = clear ? NULL : stream;
+ } else {
+ for (i=0; i<(size_t)H5_NPKGS; i++) {
+ if (!HDstrcmp(H5_debug_g.pkg[i].name, pkg_name)) {
+ H5_debug_g.pkg[i].stream = clear ? NULL : stream;
+ break;
+ } /* end if */
+ } /* end for */
+ if (i>=(size_t)H5_NPKGS)
+ fprintf(stderr, "HDF5_DEBUG: ignored %s\n", pkg_name);
+ } /* end if-else */
+
+ } else if (HDisdigit(*s)) {
+ int fd = (int)HDstrtol(s, &rest, 0);
+ H5_debug_open_stream_t *open_stream;
+
+ if((stream = HDfdopen(fd, "w")) != NULL) {
+ (void)HDsetvbuf(stream, NULL, _IOLBF, (size_t)0);
+
+ if(NULL == (open_stream = (H5_debug_open_stream_t *)H5MM_malloc(sizeof(H5_debug_open_stream_t)))) {
(void)HDfclose(stream);
return;
} /* end if */
@@ -644,11 +645,15 @@ H5_debug_mask(const char *s)
open_stream->next = H5_debug_g.open_stream;
H5_debug_g.open_stream = open_stream;
} /* end if */
- s = rest;
- } else {
- s++;
- }
- }
+
+ s = rest;
+ } else {
+ s++;
+ } /* end if-else */
+ } /* end while */
+
+ return;
+
} /* end H5_debug_mask() */
#ifdef H5_HAVE_PARALLEL
diff --git a/src/H5B.c b/src/H5B.c
index 3b34c4d..9182d25 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -1734,14 +1734,13 @@ H5B_shared_new(const H5F_t *f, const H5B_class_t *type, size_t sizeof_rkey)
(shared->two_k + 1) * shared->sizeof_rkey); /*keys */
HDassert(shared->sizeof_rnode);
- /* Allocate shared buffers */
+ /* Allocate and clear shared buffers */
if(NULL == (shared->page = H5FL_BLK_MALLOC(page, shared->sizeof_rnode)))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "memory allocation failed for B-tree page")
-#ifdef H5_CLEAR_MEMORY
-HDmemset(shared->page, 0, shared->sizeof_rnode);
-#endif /* H5_CLEAR_MEMORY */
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "memory allocation failed for B-tree page")
+ HDmemset(shared->page, 0, shared->sizeof_rnode);
+
if(NULL == (shared->nkey = H5FL_SEQ_MALLOC(size_t, (size_t)(shared->two_k + 1))))
- HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "memory allocation failed for B-tree native keys")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "memory allocation failed for B-tree native keys")
/* Initialize the offsets into the native key buffer */
for(u = 0; u < (shared->two_k + 1); u++)
diff --git a/src/H5B2cache.c b/src/H5B2cache.c
index 2c40761..928a7ee 100644
--- a/src/H5B2cache.c
+++ b/src/H5B2cache.c
@@ -890,10 +890,8 @@ H5B2__cache_int_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) <= len);
-#ifdef H5_CLEAR_MEMORY
/* Clear rest of internal node */
HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image));
-#endif /* H5_CLEAR_MEMORY */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1300,10 +1298,8 @@ H5B2__cache_leaf_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED l
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) <= len);
-#ifdef H5_CLEAR_MEMORY
/* Clear rest of leaf node */
HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image));
-#endif /* H5_CLEAR_MEMORY */
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c
index 0676f30..578eeb9 100644
--- a/src/H5B2hdr.c
+++ b/src/H5B2hdr.c
@@ -153,9 +153,7 @@ H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata,
/* Allocate "page" for node I/O */
if(NULL == (hdr->page = H5FL_BLK_MALLOC(node_page, hdr->node_size)))
HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, FAIL, "memory allocation failed")
-#ifdef H5_CLEAR_MEMORY
-HDmemset(hdr->page, 0, hdr->node_size);
-#endif /* H5_CLEAR_MEMORY */
+ HDmemset(hdr->page, 0, hdr->node_size);
/* Allocate array of node info structs */
if(NULL == (hdr->node_info = H5FL_SEQ_MALLOC(H5B2_node_info_t, (size_t)(hdr->depth + 1))))
diff --git a/src/H5B2int.c b/src/H5B2int.c
index a9c9ecc..aefb189 100644
--- a/src/H5B2int.c
+++ b/src/H5B2int.c
@@ -2962,17 +2962,15 @@ H5B2__create_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent, H5B2_node_ptr_t
/* Increment ref. count on B-tree header */
if(H5B2__hdr_incr(hdr) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, FAIL, "can't increment ref. count on B-tree header")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTINC, FAIL, "can't increment ref. count on B-tree header")
/* Share B-tree header information */
leaf->hdr = hdr;
/* Allocate space for the native keys in memory */
if(NULL == (leaf->leaf_native = (uint8_t *)H5FL_FAC_MALLOC(hdr->node_info[0].nat_rec_fac)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree leaf native keys")
-#ifdef H5_CLEAR_MEMORY
-HDmemset(leaf->leaf_native, 0, hdr->cls->nrec_size * hdr->node_info[0].max_nrec);
-#endif /* H5_CLEAR_MEMORY */
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree leaf native keys")
+ HDmemset(leaf->leaf_native, 0, hdr->cls->nrec_size * hdr->node_info[0].max_nrec);
/* Set number of records */
leaf->nrec = 0;
@@ -2986,15 +2984,15 @@ HDmemset(leaf->leaf_native, 0, hdr->cls->nrec_size * hdr->node_info[0].max_nrec)
/* Allocate space on disk for the leaf */
if(HADDR_UNDEF == (node_ptr->addr = H5MF_alloc(hdr->f, H5FD_MEM_BTREE, dxpl_id, (hsize_t)hdr->node_size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for B-tree leaf node")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for B-tree leaf node")
/* Cache the new B-tree node */
if(H5AC_insert_entry(hdr->f, dxpl_id, H5AC_BT2_LEAF, node_ptr->addr, leaf, H5AC__NO_FLAGS_SET) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree leaf to cache")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree leaf to cache")
done:
if(ret_value < 0) {
- if(leaf)
+ if(leaf)
if(H5B2__leaf_free(leaf) < 0)
HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to release v2 B-tree leaf node")
} /* end if */
@@ -3092,16 +3090,12 @@ H5B2__create_internal(H5B2_hdr_t *hdr, hid_t dxpl_id, void *parent,
/* Allocate space for the native keys in memory */
if(NULL == (internal->int_native = (uint8_t *)H5FL_FAC_MALLOC(hdr->node_info[depth].nat_rec_fac)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree internal native keys")
-#ifdef H5_CLEAR_MEMORY
-HDmemset(internal->int_native, 0, hdr->cls->nrec_size * hdr->node_info[depth].max_nrec);
-#endif /* H5_CLEAR_MEMORY */
+ HDmemset(internal->int_native, 0, hdr->cls->nrec_size * hdr->node_info[depth].max_nrec);
/* Allocate space for the node pointers in memory */
if(NULL == (internal->node_ptrs = (H5B2_node_ptr_t *)H5FL_FAC_MALLOC(hdr->node_info[depth].node_ptr_fac)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for B-tree internal node pointers")
-#ifdef H5_CLEAR_MEMORY
-HDmemset(internal->node_ptrs, 0, sizeof(H5B2_node_ptr_t) * (hdr->node_info[depth].max_nrec + 1));
-#endif /* H5_CLEAR_MEMORY */
+ HDmemset(internal->node_ptrs, 0, sizeof(H5B2_node_ptr_t) * (hdr->node_info[depth].max_nrec + 1));
/* Set number of records & depth of the node */
internal->nrec = 0;
diff --git a/src/H5Bcache.c b/src/H5Bcache.c
index 73136b4..2036257 100644
--- a/src/H5Bcache.c
+++ b/src/H5Bcache.c
@@ -353,10 +353,8 @@ H5B__serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) <= len);
-#ifdef H5_CLEAR_MEMORY
/* Clear rest of node */
HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image));
-#endif /* H5_CLEAR_MEMORY */
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c
index 6276af1..dfa18fb 100644
--- a/src/H5Dcontig.c
+++ b/src/H5Dcontig.c
@@ -1027,10 +1027,9 @@ H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len,
if(NULL == (dset_contig->sieve_buf = H5FL_BLK_CALLOC(sieve_buf, dset_contig->sieve_buf_size)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "memory allocation failed")
-#ifdef H5_CLEAR_MEMORY
-if(dset_contig->sieve_size > len)
- HDmemset(dset_contig->sieve_buf + len, 0, (dset_contig->sieve_size - len));
-#endif /* H5_CLEAR_MEMORY */
+ /* Clear memory */
+ if(dset_contig->sieve_size > len)
+ HDmemset(dset_contig->sieve_buf + len, 0, (dset_contig->sieve_size - len));
/* Determine the new sieve buffer size & location */
dset_contig->sieve_loc = addr;
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index f4aa240..778baa0 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -1295,9 +1295,7 @@ H5FD__core_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN
HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, FAIL, "unable to allocate memory block of %llu bytes", (unsigned long long)new_eof)
} /* end else */
-#ifdef H5_CLEAR_MEMORY
HDmemset(x + file->eof, 0, (size_t)(new_eof - file->eof));
-#endif /* H5_CLEAR_MEMORY */
file->mem = x;
file->eof = new_eof;
@@ -1469,10 +1467,8 @@ H5FD__core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing
HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, FAIL, "unable to allocate memory block")
} /* end else */
-#ifdef H5_CLEAR_MEMORY
if(file->eof < new_eof)
HDmemset(x + file->eof, 0, (size_t)(new_eof - file->eof));
-#endif /* H5_CLEAR_MEMORY */
file->mem = x;
/* Update backing store, if using it and if closing */
diff --git a/src/H5Faccum.c b/src/H5Faccum.c
index d8cd614..ef7c827 100644
--- a/src/H5Faccum.c
+++ b/src/H5Faccum.c
@@ -164,9 +164,9 @@ H5F__accum_read(const H5F_io_info_t *fio_info, H5FD_mem_t type, haddr_t addr,
/* Note the new buffer size */
accum->alloc_size = new_alloc_size;
-#ifdef H5_CLEAR_MEMORY
- HDmemset(accum->buf + accum->size, 0, (accum->alloc_size - accum->size));
-#endif /* H5_CLEAR_MEMORY */
+
+ /* Clear the memory */
+ HDmemset(accum->buf + accum->size, 0, (accum->alloc_size - accum->size));
} /* end if */
/* Read the part before the metadata accumulator */
@@ -395,9 +395,9 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, const H5F_io_info_t *fio_info,
/* Update accumulator info */
accum->buf = new_buf;
accum->alloc_size = new_size;
-#ifdef H5_CLEAR_MEMORY
-HDmemset(accum->buf + accum->size, 0, (accum->alloc_size - (accum->size + size)));
-#endif /* H5_CLEAR_MEMORY */
+
+ /* Clear the memory */
+ HDmemset(accum->buf + accum->size, 0, (accum->alloc_size - (accum->size + size)));
} /* end if */
} /* end if */
@@ -628,9 +628,9 @@ H5F__accum_write(const H5F_io_info_t *fio_info, H5FD_mem_t type, haddr_t addr,
/* Note the new buffer size */
accum->alloc_size = new_alloc_size;
-#ifdef H5_CLEAR_MEMORY
-HDmemset(accum->buf + size, 0, (accum->alloc_size - size));
-#endif /* H5_CLEAR_MEMORY */
+
+ /* Clear the memory */
+ HDmemset(accum->buf + size, 0, (accum->alloc_size - size));
} /* end if */
/* Copy the new metadata to the buffer */
@@ -661,6 +661,7 @@ HDmemset(accum->buf + size, 0, (accum->alloc_size - size));
/* Check if we need to resize the buffer */
if(size > accum->alloc_size) {
size_t new_size; /* New size of accumulator */
+ size_t clear_size; /* Size of memory that needs clearing */
/* Adjust the buffer size to be a power of 2 that is large enough to hold data */
new_size = (size_t)1 << (1 + H5VM_log2_gen((uint64_t)(size - 1)));
@@ -671,12 +672,10 @@ HDmemset(accum->buf + size, 0, (accum->alloc_size - size));
/* Note the new buffer size */
accum->alloc_size = new_size;
-#ifdef H5_CLEAR_MEMORY
-{
-size_t clear_size = MAX(accum->size, size);
-HDmemset(accum->buf + clear_size, 0, (accum->alloc_size - clear_size));
-}
-#endif /* H5_CLEAR_MEMORY */
+
+ /* Clear the memory */
+ clear_size = MAX(accum->size, size);
+ HDmemset(accum->buf + clear_size, 0, (accum->alloc_size - clear_size));
} /* end if */
else {
/* Check if we should shrink the accumulator buffer */
@@ -721,9 +720,9 @@ HDmemset(accum->buf + clear_size, 0, (accum->alloc_size - clear_size));
/* Note the new buffer size */
accum->alloc_size = new_size;
-#ifdef H5_CLEAR_MEMORY
-HDmemset(accum->buf + size, 0, (accum->alloc_size - size));
-#endif /* H5_CLEAR_MEMORY */
+
+ /* Clear the memory */
+ HDmemset(accum->buf + size, 0, (accum->alloc_size - size));
} /* end if */
/* Update the metadata accumulator information */
diff --git a/src/H5Gcache.c b/src/H5Gcache.c
index a4f9530..ed1c4a3 100644
--- a/src/H5Gcache.c
+++ b/src/H5Gcache.c
@@ -328,10 +328,8 @@ H5G__cache_node_serialize(const H5F_t *f, void *_image, size_t len,
if(H5G__ent_encode_vec(f, &image, sym->entry, sym->nsyms) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "can't serialize")
-#ifdef H5_CLEAR_MEMORY
/* Clear rest of symbol table node */
HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image));
-#endif /* H5_CLEAR_MEMORY */
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h
index 1ab5522..2ef99fd 100644
--- a/src/H5Gprivate.h
+++ b/src/H5Gprivate.h
@@ -37,13 +37,6 @@
#include "H5RSprivate.h" /* Reference-counted strings */
/*
- * Define this to enable debugging.
- */
-#ifdef NDEBUG
-# undef H5G_DEBUG
-#endif
-
-/*
* The disk size for a symbol table entry...
*/
#define H5G_SIZEOF_SCRATCH 16
diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c
index 73db840..1272ab0 100644
--- a/src/H5HFdblock.c
+++ b/src/H5HFdblock.c
@@ -146,9 +146,7 @@ H5HF_man_dblock_create(hid_t dxpl_id, H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblo
/* XXX: Change to using free-list factories */
if((dblock->blk = H5FL_BLK_MALLOC(direct_block, dblock->size)) == NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
-#ifdef H5_CLEAR_MEMORY
-HDmemset(dblock->blk, 0, dblock->size);
-#endif /* H5_CLEAR_MEMORY */
+ HDmemset(dblock->blk, 0, dblock->size);
dblock->write_buf = NULL;
dblock->write_size = 0;
diff --git a/src/H5HFtiny.c b/src/H5HFtiny.c
index bdfe30d..711ceb9 100644
--- a/src/H5HFtiny.c
+++ b/src/H5HFtiny.c
@@ -177,10 +177,9 @@ HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size);
((enc_obj_size & H5HF_TINY_MASK_EXT_1) >> 8));
*id++ = enc_obj_size & H5HF_TINY_MASK_EXT_2;
} /* end else */
+
HDmemcpy(id, obj, obj_size);
-#ifdef H5_CLEAR_MEMORY
-HDmemset(id + obj_size, 0, (hdr->id_len - ((size_t)1 + (size_t)hdr->tiny_len_extended + obj_size)));
-#endif /* H5_CLEAR_MEMORY */
+ HDmemset(id + obj_size, 0, (hdr->id_len - ((size_t)1 + (size_t)hdr->tiny_len_extended + obj_size)));
/* Update statistics about heap */
hdr->tiny_size += obj_size;
diff --git a/src/H5HG.c b/src/H5HG.c
index 41c5007..f95b607 100644
--- a/src/H5HG.c
+++ b/src/H5HG.c
@@ -154,22 +154,20 @@ H5HG_create(H5F_t *f, hid_t dxpl_id, size_t size)
/* Create it */
H5_CHECK_OVERFLOW(size, size_t, hsize_t);
if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_GHEAP, dxpl_id, (hsize_t)size)))
- HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate file space for global heap")
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate file space for global heap")
if(NULL == (heap = H5FL_MALLOC(H5HG_heap_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed")
heap->addr = addr;
heap->size = size;
heap->shared = H5F_SHARED(f);
if(NULL == (heap->chunk = H5FL_BLK_MALLOC(gheap_chunk, size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed")
-#ifdef H5_CLEAR_MEMORY
-HDmemset(heap->chunk, 0, size);
-#endif /* H5_CLEAR_MEMORY */
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed")
+ HDmemset(heap->chunk, 0, size);
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)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed")
/* Initialize the header */
HDmemcpy(heap->chunk, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC);
@@ -452,9 +450,7 @@ H5HG_extend(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t need)
/* Re-allocate the heap information in memory */
if(NULL == (new_chunk = H5FL_BLK_REALLOC(gheap_chunk, heap->chunk, (heap->size + need))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "new heap allocation failed")
-#ifdef H5_CLEAR_MEMORY
-HDmemset(new_chunk + heap->size, 0, need);
-#endif /* H5_CLEAR_MEMORY */
+ HDmemset(new_chunk + heap->size, 0, need);
/* Adjust the size of the heap */
old_size = heap->size;
diff --git a/src/H5HLcache.c b/src/H5HLcache.c
index 678da7f..d0dde89 100644
--- a/src/H5HLcache.c
+++ b/src/H5HLcache.c
@@ -630,10 +630,8 @@ H5HL__cache_prefix_serialize(const H5F_t *f, void *_image, size_t len,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) <= len);
-#ifdef H5_CLEAR_MEMORY
/* Clear rest of local heap */
HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image));
-#endif /* H5_CLEAR_MEMORY */
} /* end else */
FUNC_LEAVE_NOAPI(SUCCEED)
diff --git a/src/H5MFprivate.h b/src/H5MFprivate.h
index bb07f4e..22ed308 100644
--- a/src/H5MFprivate.h
+++ b/src/H5MFprivate.h
@@ -21,8 +21,6 @@
*
* Purpose: Private header file for file memory management.
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#ifndef _H5MFprivate_H
@@ -36,13 +34,6 @@
/* Library Private Macros */
/**************************/
-/*
- * Feature: Define H5MF_DEBUG on the compiler command line if you want to
- * see diagnostics from this layer.
- */
-#ifdef NDEBUG
-# undef H5MF_DEBUG
-#endif
/****************************/
/* Library Private Typedefs */
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index 03a4668..44872ba 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -2517,8 +2517,8 @@ done:
*
* If the length of the filename, which determines the
* required value of size, is unknown, a preliminary call to
- * H5Pget_virtual_filename with the last two parameters set
- * to NULL can be made. The return value of this call will
+ * H5Pget_virtual_filename with 'name' set to NULL and 'size'
+ * set to zero can be made. The return value of this call will
* be the size in bytes of the filename. That value, plus 1
* for a NULL terminator, is then assigned to size for a
* second H5Pget_virtual_filename call, which will retrieve
@@ -2578,14 +2578,14 @@ done:
* additional characters, if any, are not returned to the
* user application.
*
- * If the length of the filename, which determines the
+ * If the length of the dataset name, which determines the
* required value of size, is unknown, a preliminary call to
- * H5Pget_virtual_dsetname with the last two parameters set
- * to NULL can be made. The return value of this call will
- * be the size in bytes of the filename. That value, plus 1
+ * H5Pget_virtual_dsetname with 'name' set to NULL and 'size'
+ * set to zero can be made. The return value of this call will
+ * be the size in bytes of the dataset name. That value, plus 1
* for a NULL terminator, is then assigned to size for a
* second H5Pget_virtual_dsetname call, which will retrieve
- * the actual filename.
+ * the actual dataset name.
*
* Return: Returns the length of the name if successful, otherwise
* returns a negative value.
diff --git a/src/H5SMcache.c b/src/H5SMcache.c
index 7b94743..ff2b09f 100644
--- a/src/H5SMcache.c
+++ b/src/H5SMcache.c
@@ -769,9 +769,8 @@ H5SM__cache_list_serialize(const H5F_t *f, void *_image, size_t len,
/* sanity check */
HDassert((size_t)(image - (uint8_t *)_image) <= list->header->list_size);
-#ifdef H5_CLEAR_MEMORY
+ /* Clear memory */
HDmemset(image, 0, (list->header->list_size - (size_t)(image - (uint8_t *)_image)));
-#endif /* H5_CLEAR_MEMORY */
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5STprivate.h b/src/H5STprivate.h
index 892f04a..9b49b07 100644
--- a/src/H5STprivate.h
+++ b/src/H5STprivate.h
@@ -58,7 +58,9 @@ H5_DLL H5ST_ptr_t H5ST_findfirst(H5ST_tree_t *p);
H5_DLL H5ST_ptr_t H5ST_findnext(H5ST_ptr_t p);
H5_DLL void *H5ST_remove(H5ST_tree_t *root, const char *s);
H5_DLL herr_t H5ST_delete(H5ST_tree_t *root, H5ST_ptr_t p);
-H5_DLL herr_t H5ST_dump(H5ST_ptr_t p);
+#ifdef H5ST_DEBUG
+H5_DLL herr_t H5ST_dump(H5ST_tree_t *tree);
+#endif /* H5ST_DEBUG */
#endif /* _H5STprivate_H */
diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c
index 0dc12a3..14ca9db 100644
--- a/src/H5Zscaleoffset.c
+++ b/src/H5Zscaleoffset.c
@@ -883,10 +883,8 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id)
if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
-#ifdef H5_CLEAR_MEMORY
/* Initialize the parameters to a known state */
HDmemset(cd_values, 0, sizeof(cd_values));
-#endif /* H5_CLEAR_MEMORY */
/* Get the filter's current parameters */
if(H5P_get_filter_by_id(dcpl_plist, H5Z_FILTER_SCALEOFFSET, &flags, &cd_nelmts, cd_values, (size_t)0, NULL, NULL) < 0)
@@ -1266,13 +1264,11 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value
for(i = 0; i < sizeof(unsigned long long); i++)
((unsigned char *)outbuf)[5+i] = (unsigned char)((minval & ((unsigned long long)0xff << i*8)) >> i*8);
-#ifdef H5_CLEAR_MEMORY
/* Zero out remaining, unused bytes */
/* (Looks like an error in the original determination of how many
* bytes would be needed for parameters. - QAK, 2010/08/19)
*/
HDmemset(outbuf + 13, 0, (size_t)8);
-#endif /* H5_CLEAR_MEMORY */
/* special case: minbits equal to full precision */
if(minbits == p.size * 8) {
diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in
index 90224c1..3bb2936 100644
--- a/src/libhdf5.settings.in
+++ b/src/libhdf5.settings.in
@@ -3,40 +3,47 @@
General Information:
-------------------
- HDF5 Version: @H5_VERSION@
- Configured on: @CONFIG_DATE@
- Configured by: @CONFIG_USER@
- Configure mode: @CONFIG_MODE@
- Host system: @host_cpu@-@host_vendor@-@host_os@
- Uname information: @UNAME_INFO@
- Byte sex: @BYTESEX@
- Libraries: @STATIC_SHARED@
- Installation point: @prefix@
+ HDF5 Version: @H5_VERSION@
+ Configured on: @CONFIG_DATE@
+ Configured by: @CONFIG_USER@
+ Host system: @host_cpu@-@host_vendor@-@host_os@
+ Uname information: @UNAME_INFO@
+ Byte sex: @BYTESEX@
+ Installation point: @prefix@
Compiling Options:
------------------
- Compilation Mode: @CONFIG_MODE@
- C Compiler: @CC_VERSION@
- CFLAGS: @CFLAGS@
- H5_CFLAGS: @H5_CFLAGS@
- AM_CFLAGS: @AM_CFLAGS@
- CPPFLAGS: @CPPFLAGS@
- H5_CPPFLAGS: @H5_CPPFLAGS@
- AM_CPPFLAGS: @AM_CPPFLAGS@
- Shared C Library: @enable_shared@
- Static C Library: @enable_static@
+ Build Mode: @BUILD_MODE@
+ Debugging Symbols: @SYMBOLS@
+ Asserts: @ASSERTS@
+ Profiling: @PROFILING@
+ Optimization Level: @OPTIMIZATION@
+
+Linking Options:
+----------------
+ Libraries: @STATIC_SHARED@
Statically Linked Executables: @LT_STATIC_EXEC@
LDFLAGS: @LDFLAGS@
H5_LDFLAGS: @H5_LDFLAGS@
AM_LDFLAGS: @AM_LDFLAGS@
- Extra libraries: @LIBS@
- Archiver: @AR@
- Ranlib: @RANLIB@
- Debugged Packages: @DEBUG_PKG@
- API Tracing: @TRACE_API@
+ Extra libraries: @LIBS@
+ Archiver: @AR@
+ Ranlib: @RANLIB@
Languages:
----------
+ C: yes
+ C Compiler: @CC_VERSION@
+ CPPFLAGS: @CPPFLAGS@
+ H5_CPPFLAGS: @H5_CPPFLAGS@
+ AM_CPPFLAGS: @AM_CPPFLAGS@
+ C Flags: @CFLAGS@
+ H5 C Flags: @H5_CFLAGS@
+ AM C Flags: @AM_CFLAGS@
+ Shared C Library: @enable_shared@
+ Static C Library: @enable_static@
+
+
Fortran: @HDF_FORTRAN@
@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Compiler: @FC_VERSION@
@BUILD_FORTRAN_CONDITIONAL_TRUE@ Fortran Flags: @FCFLAGS@
@@ -56,17 +63,19 @@ Languages:
Features:
---------
Parallel HDF5: @PARALLEL@
- High Level library: @HDF5_HL@
+ High-level library: @HDF5_HL@
Threadsafety: @THREADSAFE@
- Default API Mapping: @DEFAULT_API_VERSION@
- With Deprecated Public Symbols: @DEPRECATED_SYMBOLS@
+ Default API mapping: @DEFAULT_API_VERSION@
+ With deprecated public symbols: @DEPRECATED_SYMBOLS@
I/O filters (external): @EXTERNAL_FILTERS@
MPE: @MPE@
Direct VFD: @DIRECT_VFD@
dmalloc: @HAVE_DMALLOC@
-Clear file buffers before write: @CLEARFILEBUF@
+ Packages w/ extra debug output: @INTERNAL_DEBUG_OUTPUT@
+ API tracing: @TRACE_API@
Using memory checker: @USINGMEMCHECKER@
Memory allocation sanity checks: @MEMORYALLOCSANITYCHECK@
- Function Stack Tracing: @CODESTACK@
- Strict File Format Checks: @STRICT_FORMAT_CHECKS@
- Optimization Instrumentation: @INSTRUMENT@
+ Metadata trace file: @METADATATRACEFILE@
+ Function stack tracing: @CODESTACK@
+ Strict file format checks: @STRICT_FORMAT_CHECKS@
+ Optimization instrumentation: @INSTRUMENT_LIBRARY@