summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-05-01 03:28:55 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-05-01 03:28:55 (GMT)
commit67eb0968e1cc0e3d08c3f953a92a6ddb7ee980fe (patch)
treef52d9e2e1c3f7b9867d12debce5b10a50135bc90 /src/H5D.c
parentf202e3dba4171dba3e5be2f4cee34445a5239875 (diff)
downloadhdf5-67eb0968e1cc0e3d08c3f953a92a6ddb7ee980fe.zip
hdf5-67eb0968e1cc0e3d08c3f953a92a6ddb7ee980fe.tar.gz
hdf5-67eb0968e1cc0e3d08c3f953a92a6ddb7ee980fe.tar.bz2
[svn-r8455] 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 f3affc4..e0076de 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;