diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-01-18 14:32:27 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-01-18 14:32:27 (GMT) |
commit | 9155785889af8ae809fb5e9cdbb330710a174d72 (patch) | |
tree | 1aa6540340928a3c5b05bb240540ce6aa48ec6be /src | |
parent | fa11904aabebe64af2d90be3b3203203569e0bcb (diff) | |
download | hdf5-9155785889af8ae809fb5e9cdbb330710a174d72.zip hdf5-9155785889af8ae809fb5e9cdbb330710a174d72.tar.gz hdf5-9155785889af8ae809fb5e9cdbb330710a174d72.tar.bz2 |
[svn-r13152] Description:
Add anotherdense/shared attribute test.
Clean up minor attribute/object header codelets, in preparation for
adding creation index to attributes.
Tested on:
Mac OS X/32 10.4.8 (amazon)
FreeBSD/32 6.2 (duty)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Adense.c | 5 | ||||
-rw-r--r-- | src/H5Apkg.h | 2 | ||||
-rw-r--r-- | src/H5Oattr.c | 10 | ||||
-rw-r--r-- | src/H5Oattribute.c | 2 | ||||
-rw-r--r-- | src/H5Omessage.c | 25 | ||||
-rwxr-xr-x | src/H5SM.c | 5 |
6 files changed, 30 insertions, 19 deletions
diff --git a/src/H5Adense.c b/src/H5Adense.c index e9eeafa..0418427 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -48,6 +48,11 @@ /****************/ /* Fractal heap creation parameters for "dense" attribute storage */ +/* (Note that these parameters have been tuned so that the resulting heap ID + * is exactly 8 bytes. This is an efficient size and is also the same as + * the size of the shared message heap IDs, think carefully before + * changing it. -QAK) + */ #define H5A_FHEAP_MAN_WIDTH 4 #define H5A_FHEAP_MAN_START_BLOCK_SIZE 512 #define H5A_FHEAP_MAN_MAX_DIRECT_SIZE (64 * 1024) diff --git a/src/H5Apkg.h b/src/H5Apkg.h index 82471d1..ca4b50d 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -65,13 +65,13 @@ struct H5A_t { H5O_loc_t oloc; /* Object location for object attribute is on */ H5G_name_t path; /* Group hierarchy path */ char *name; /* Attribute's name */ + H5T_cset_t encoding; /* Character encoding of attribute name */ H5T_t *dt; /* Attribute's datatype */ size_t dt_size; /* Size of datatype on disk */ H5S_t *ds; /* Attribute's dataspace */ size_t ds_size; /* Size of dataspace on disk */ void *data; /* Attribute data (on a temporary basis) */ size_t data_size; /* Size of data on disk */ - H5T_cset_t encoding; /* Character encoding of attribute */ H5O_shared_t sh_loc; /* Location of shared message */ }; diff --git a/src/H5Oattr.c b/src/H5Oattr.c index c29c19e..d70aab0 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -834,7 +834,7 @@ H5O_attr_copy_file(H5F_t *file_src, const H5O_msg_class_t UNUSED *mesg_type, /* Don't have an opened group location for copy */ H5O_loc_reset(&(attr_dst->oloc)); H5G_name_reset(&(attr_dst->path)); - attr_dst->obj_opened = 0; + attr_dst->obj_opened = FALSE; /* Copy attribute's name */ attr_dst->name = H5MM_strdup(attr_src->name); @@ -1205,12 +1205,12 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in fprintf(stream, "%*s%-*s \"%s\"\n", indent, "", fwidth, "Name:", mesg->name); - fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, + HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, "Initialized:", - (unsigned int)mesg->initialized); - fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, + mesg->initialized); + HDfprintf(stream, "%*s%-*s %t\n", indent, "", fwidth, "Object opened:", - (unsigned int)mesg->obj_opened); + mesg->obj_opened); HDfprintf(stream, "%*s%-*s %a\n", indent, "", fwidth, "Object:", mesg->oloc.addr); diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 237e352..6cc3c02 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -252,7 +252,7 @@ HDfprintf(stderr, "%s: adding attribute, attr->name = '%s'\n", FUNC, attr->name) * "delete" callback until the reference count drops to zero. * However, attributes have already increased the reference * count on shared components before passing the attribute - * to the shared message code to manage, causing an assymetry + * to the shared message code to manage, causing an asymmetry * in the reference counting for any shared components. * * The alternate solution is to have the shared message's "try diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 54bbdf4..2e01516 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -103,7 +103,7 @@ static unsigned H5O_new_mesg(H5F_t *f, H5O_t *oh, unsigned *flags, const H5O_msg_class_t *orig_type, const void *orig_mesg, H5O_shared_t *sh_mesg, const H5O_msg_class_t **new_type, const void **new_mesg, hid_t dxpl_id, unsigned *oh_flags_ptr); -static herr_t H5O_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, +static herr_t H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, const H5O_msg_class_t *type, const void *mesg, unsigned flags, unsigned update_flags, unsigned *oh_flags_ptr); @@ -272,8 +272,8 @@ H5O_msg_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *t if((idx = H5O_new_mesg(f, oh, &mesg_flags, type, mesg, &sh_mesg, &new_type, &new_mesg, dxpl_id, oh_flags_ptr)) == UFAIL) HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, FAIL, "unable to create new message") - /* Write the information to the message */ - if(H5O_write_mesg(f, dxpl_id, oh, idx, new_type, new_mesg, mesg_flags, update_flags, oh_flags_ptr) < 0) + /* Copy the information for the message */ + if(H5O_copy_mesg(f, dxpl_id, oh, idx, new_type, new_mesg, mesg_flags, update_flags, oh_flags_ptr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to write message") #ifdef H5O_DEBUG H5O_assert(oh); @@ -458,8 +458,8 @@ H5O_msg_write_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, write_mesg = &sh_mesg; } /* end if */ - /* Write the information to the message */ - if(H5O_write_mesg(f, dxpl_id, oh, idx, write_type, write_mesg, mesg_flags, update_flags, oh_flags_ptr) < 0) + /* Copy the information for the message */ + if(H5O_copy_mesg(f, dxpl_id, oh, idx, write_type, write_mesg, mesg_flags, update_flags, oh_flags_ptr) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to write message") #ifdef H5O_DEBUG H5O_assert(oh); @@ -2001,9 +2001,10 @@ done: /*------------------------------------------------------------------------- - * Function: H5O_write_mesg + * Function: H5O_copy_mesg * - * Purpose: Write message to object header + * Purpose: Make a copy of the native object for an object header's + * native message info * * Return: Non-negative on success/Negative on failure * @@ -2013,14 +2014,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, +H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, const H5O_msg_class_t *type, const void *mesg, unsigned mesg_flags, unsigned update_flags, unsigned *oh_flags_ptr) { H5O_mesg_t *idx_msg; /* Pointer to message to modify */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_write_mesg) + FUNC_ENTER_NOAPI_NOINIT(H5O_copy_mesg) /* check args */ HDassert(f); @@ -2032,10 +2033,10 @@ H5O_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, /* Set pointer to the correct message */ idx_msg = &oh->mesg[idx]; - /* Reset existing native information */ + /* Reset existing native information for the header's message */ H5O_msg_reset_real(type, idx_msg->native); - /* Copy the native value for the message */ + /* Copy the native object for the message */ if(NULL == (idx_msg->native = (type->copy)(mesg, idx_msg->native))) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to copy message to object header") @@ -2053,7 +2054,7 @@ H5O_write_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_write_mesg() */ +} /* end H5O_copy_mesg() */ /*------------------------------------------------------------------------- @@ -35,6 +35,11 @@ /* Local Macros */ /****************/ /* Values used to create the SOHM heaps */ +/* (Note that these parameters have been tuned so that the resulting heap ID + * is exactly 8 bytes. This is an efficient size and is also the same as + * the size of the attribute heap IDs, think carefully before changing it. + * -QAK) + */ #define H5SM_FHEAP_MAN_WIDTH 4 #define H5SM_FHEAP_MAN_START_BLOCK_SIZE 1024 #define H5SM_FHEAP_MAN_MAX_DIRECT_SIZE (64 * 1024) |