summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-05-01 03:29:00 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-05-01 03:29:00 (GMT)
commit4f0b880861c6d719ef30302ebc522abdaf84b292 (patch)
tree15cd04cb350ccb916cd393dd2d19c54ab6997b77 /src/H5D.c
parenta4281bd2f22a871fb9a5f7d5b0180f19efc3c73d (diff)
downloadhdf5-4f0b880861c6d719ef30302ebc522abdaf84b292.zip
hdf5-4f0b880861c6d719ef30302ebc522abdaf84b292.tar.gz
hdf5-4f0b880861c6d719ef30302ebc522abdaf84b292.tar.bz2
[svn-r8456] Purpose:
Code optimization Description: Eliminate more 64-bit multiplies by remebering the size of contiguous datasets as well as chunked datasets. Platforms tested: Solaris 2.7 (arabica) FreeBSD 4.9 (sleipnir) too minor to require h5committest
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 2fb268f..58aa1a3 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -2073,6 +2073,10 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space
} else if (ndims>0 && max_dim[0]>new_dset->layout.dim[0]) {
HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, NULL, "extendible contiguous non-external dataset")
}
+
+ /* Compute the total size of a chunk */
+ for (u=1, new_dset->layout.chunk_size=new_dset->layout.dim[0]; u<new_dset->layout.ndims; u++)
+ new_dset->layout.chunk_size *= new_dset->layout.dim[u];
break;
case H5D_CHUNKED:
@@ -2104,7 +2108,7 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space
new_dset->layout.dim[u] = chunk_size[u];
/* Compute the total size of a chunk */
- for (u=0, new_dset->layout.chunk_size=1; u<new_dset->layout.ndims; u++)
+ for (u=1, new_dset->layout.chunk_size=new_dset->layout.dim[0]; u<new_dset->layout.ndims; u++)
new_dset->layout.chunk_size *= new_dset->layout.dim[u];
break;