summaryrefslogtreecommitdiffstats
path: root/src/H5Dmpio.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-05-16 03:27:13 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-05-16 03:27:13 (GMT)
commitc23c6b939229efde53e105008d29b8bf441f5d99 (patch)
treef38a5b13b938dcf88fa5d7c33b613adaa1f2396c /src/H5Dmpio.c
parent70cdaa12b2bceadd6a6f6d7b66eaad626e8523d6 (diff)
downloadhdf5-c23c6b939229efde53e105008d29b8bf441f5d99.zip
hdf5-c23c6b939229efde53e105008d29b8bf441f5d99.tar.gz
hdf5-c23c6b939229efde53e105008d29b8bf441f5d99.tar.bz2
[svn-r15016] Description:
Port revision 15015 back to 1.8 branch: > Detect chunks that are >4GB before dataset gets created and return error > to application. > > Tweak lots of internal variables that hold the chunk size/dimensions to > use an 'uint32_t', instead of a 'size_t', so that the integer size is constant. > > Correct a number of our tests which were creating datasets with chunks > that were >4GB and add some specific tests for >4GB chunk size detection. > > Minor whitespace & other code cleanups. Tested on: Mac OS X/32 10.5.2 (amazon) Forthcoming testing on other platforms...
Diffstat (limited to 'src/H5Dmpio.c')
-rw-r--r--src/H5Dmpio.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index 889fbce..dd0c602 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -1183,7 +1183,7 @@ if(H5DEBUG(D))
H5D_io_info_t *chk_io_info; /* Pointer to I/O info object for this chunk */
H5D_istore_ud1_t udata; /* B-tree pass-through */
void *chunk; /* Pointer to the data chunk in cache */
- size_t accessed_bytes; /* Total accessed size in a chunk */
+ uint32_t accessed_bytes; /* Total accessed size in a chunk */
unsigned idx_hint = 0; /* Cache index hint */
haddr_t caddr; /* Address of the cached chunk */
@@ -1203,9 +1203,11 @@ if(H5DEBUG(D))
/* Load the chunk into cache and lock it. */
if(H5D_chunk_cacheable(io_info, caddr)) {
hbool_t entire_chunk = TRUE; /* Whether whole chunk is selected */
+ size_t tmp_accessed_bytes; /* Total accessed size in a chunk */
/* Compute # of bytes accessed in chunk */
- accessed_bytes = chunk_info->chunk_points * type_info->src_type_size;
+ tmp_accessed_bytes = chunk_info->chunk_points * type_info->src_type_size;
+ H5_ASSIGN_OVERFLOW(accessed_bytes, tmp_accessed_bytes, size_t, uint32_t);
/* Determine if we will access all the data in the chunk */
if(((io_info->op_type == H5D_IO_OP_WRITE) && (accessed_bytes != ctg_store.contig.dset_size))
@@ -1419,7 +1421,7 @@ if(H5DEBUG(D)) {
if(make_ind) {
void *chunk; /* Pointer to the data chunk in cache */
H5D_io_info_t *chk_io_info; /* Pointer to I/O info object for this chunk */
- size_t accessed_bytes = 0; /* Total accessed size in a chunk */
+ uint32_t accessed_bytes = 0; /* Total accessed size in a chunk */
unsigned idx_hint = 0; /* Cache index hint */
/* Switch to independent I/O */
@@ -1429,9 +1431,11 @@ if(H5DEBUG(D)) {
/* Load the chunk into cache and lock it. */
if(H5D_chunk_cacheable(io_info, chunk_addr)) {
hbool_t entire_chunk = TRUE; /* Whether whole chunk is selected */
+ size_t tmp_accessed_bytes; /* Total accessed size in a chunk */
/* Compute # of bytes accessed in chunk */
- accessed_bytes = chunk_info->chunk_points * type_info->src_type_size;
+ tmp_accessed_bytes = chunk_info->chunk_points * type_info->src_type_size;
+ H5_ASSIGN_OVERFLOW(accessed_bytes, tmp_accessed_bytes, size_t, uint32_t);
/* Determine if we will access all the data in the chunk */
if(((io_info->op_type == H5D_IO_OP_WRITE) && (accessed_bytes != ctg_store.contig.dset_size))