summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2002-10-04 20:51:00 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2002-10-04 20:51:00 (GMT)
commitbc6f56390ae85bf312693e561f9fb1e9d2ca327a (patch)
tree64972aa374fa19c9016549382f87a3ed6850cf92 /src/H5D.c
parentacb356d30928d02170dd275073d19344e2f0cb9b (diff)
downloadhdf5-bc6f56390ae85bf312693e561f9fb1e9d2ca327a.zip
hdf5-bc6f56390ae85bf312693e561f9fb1e9d2ca327a.tar.gz
hdf5-bc6f56390ae85bf312693e561f9fb1e9d2ca327a.tar.bz2
[svn-r5959]
Purpose: Performance improvement for compact dataset. Platforms tested: Linux 2.2(eirene), Solaris 2.7(arabica), IRIX64 6.5(modi4)
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/H5D.c b/src/H5D.c
index d98c194..5bac61d 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -1531,6 +1531,7 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type,
H5D_fill_value_t fill_status;
H5P_genplist_t *plist; /* Property list */
H5P_genplist_t *new_plist; /* New Property list */
+ size_t ohdr_size=H5D_MINHDR_SIZE; /* Size of dataset's object header */
FUNC_ENTER_NOAPI(H5D_create, NULL);
@@ -1708,6 +1709,8 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type,
if ((ndims=H5S_get_simple_extent_dims(space, new_dset->layout.dim, max_dim))<0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize dimension size of compact dataset storage");
/* remember to check if size is small enough to fit header message */
+ ohdr_size+=new_dset->layout.size;
+
break;
default:
@@ -1715,7 +1718,7 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type,
} /* end switch */
/* Create (open for write access) an object header */
- if (H5O_create(f, 256, &(new_dset->ent)) < 0)
+ if (H5O_create(f, ohdr_size, &(new_dset->ent)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to create dataset object header");
/* Retrieve properties of fill value and others. Copy them into new fill