summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-03-06 17:37:28 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-03-06 17:37:28 (GMT)
commitf25328a15af33de7f804728776ec407ca4393b25 (patch)
tree7c48b35f9f139299aa75ce00d017b5860d857423 /src
parent2b14b281442a6890cc36b799c6ec5eedf365dcfc (diff)
downloadhdf5-f25328a15af33de7f804728776ec407ca4393b25.zip
hdf5-f25328a15af33de7f804728776ec407ca4393b25.tar.gz
hdf5-f25328a15af33de7f804728776ec407ca4393b25.tar.bz2
[svn-r13469] Description:
Minor code rearrangements and comment cleanups, in preparation for moving attribute tracking information out of object header prefix. Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'src')
-rw-r--r--src/H5O.c30
-rw-r--r--src/H5Oattribute.c2
2 files changed, 17 insertions, 15 deletions
diff --git a/src/H5O.c b/src/H5O.c
index ca740de..52610cf 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -645,7 +645,7 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, hid_t ocpl_id,
/* Make certain we allocate at least a reasonable size for the object header */
size_hint = H5O_ALIGN_F(f, MAX(H5O_MIN_SIZE, size_hint));
- /* Allocate the object header and fill in header fields */
+ /* Allocate the object header and zero out header fields */
if(NULL == (oh = H5FL_CALLOC(H5O_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
@@ -662,28 +662,30 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, hid_t ocpl_id,
if(NULL == (oc_plist = H5I_object(ocpl_id)))
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a property list")
- /* Initialize attribute tracking fields */
-
- /* Retrieve phase change values from property list */
- if(H5P_get(oc_plist, H5O_CRT_ATTR_MAX_COMPACT_NAME, &oh->max_compact) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get max. # of compact attributes")
- if(H5P_get(oc_plist, H5O_CRT_ATTR_MIN_DENSE_NAME, &oh->min_dense) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get min. # of dense attributes")
-
- /* Get object header flags */
+ /* Get any object header status flags set by properties */
if(H5P_get(oc_plist, H5O_CRT_OHDR_FLAGS_NAME, &oh->flags) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get object header flags")
- /* Initialize all time fields with current time */
+ /* Initialize all time fields with current time, if we are storing them */
if(oh->flags & H5O_HDR_STORE_TIMES)
oh->atime = oh->mtime = oh->ctime = oh->btime = H5_now();
else
oh->atime = oh->mtime = oh->ctime = oh->btime = 0;
- /* Set starting values for attribute info */
+ /* Initialize attribute tracking fields */
+
+ /* Retrieve attribute storage phase change values from property list */
+ if(H5P_get(oc_plist, H5O_CRT_ATTR_MAX_COMPACT_NAME, &oh->max_compact) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get max. # of compact attributes")
+ if(H5P_get(oc_plist, H5O_CRT_ATTR_MIN_DENSE_NAME, &oh->min_dense) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get min. # of dense attributes")
+
+ /* Set starting values for dense attribute storage info */
oh->attr_fheap_addr = HADDR_UNDEF;
oh->name_bt2_addr = HADDR_UNDEF;
oh->corder_bt2_addr = HADDR_UNDEF;
+
+ /* Check for non-default attribute storage phase change values */
} /* end if */
else {
/* Flags */
@@ -732,7 +734,7 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, hid_t ocpl_id,
if(NULL == (oh->mesg = H5FL_SEQ_CALLOC(H5O_mesg_t, oh->alloc_nmesgs)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
- /* Initialize the first message */
+ /* Initialize the initial "null" message, covering the entire first chunk */
oh->mesg[0].type = H5O_MSG_NULL;
oh->mesg[0].dirty = TRUE;
oh->mesg[0].native = NULL;
@@ -1916,7 +1918,7 @@ H5O_get_info(H5O_loc_t *oloc, H5O_info_t *oinfo, hid_t dxpl_id)
if(H5O_ATTR_ID == curr_msg->type->id)
oinfo->num_attrs++;
- /* Accumulate information, based on the type of message */
+ /* Accumulate space usage information, based on the type of message */
if(H5O_NULL_ID == curr_msg->type->id)
oinfo->hdr.space.free += H5O_SIZEOF_MSGHDR_OH(oh) + curr_msg->raw_size;
else if(H5O_CONT_ID == curr_msg->type->id)
diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c
index ac76f78..9637055 100644
--- a/src/H5Oattribute.c
+++ b/src/H5Oattribute.c
@@ -255,7 +255,7 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr)
} /* end if */
} /* end if */
- /* Increment attribute count */
+ /* Increment attribute count on object */
oh->nattrs++;
/* Later versions of the object header track the creation index on all messages */