diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-11-22 17:14:40 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-11-22 17:14:40 (GMT) |
commit | 2cf4e3037702673813530c31e7983794faf2bac2 (patch) | |
tree | 163a3de8816f4d59fa0cdf2d4d7e0359dba15925 /src/H5Osdspace.c | |
parent | e99a1f7838d12cb734edf860b15da18d2e4e5f83 (diff) | |
download | hdf5-2cf4e3037702673813530c31e7983794faf2bac2.zip hdf5-2cf4e3037702673813530c31e7983794faf2bac2.tar.gz hdf5-2cf4e3037702673813530c31e7983794faf2bac2.tar.bz2 |
[svn-r9557] Purpose:
Code cleanup & optimization
Description:
Improve ADF/CGNS benchmark by reducing the number of internal attribute
copies made during creations, opens and writes.
Added new H5O_iterate() routine for iterating through messages of a certain
type in the object header (attributes are the only message currently that can
have multiple instances in the object header).
Cross-pollinated various minor code cleanups to reduce diffs between
branches.
Platforms tested:
FreeBSD 4.10 (sleipnir) w/parallel
Solaris 2.7 (arabica)
Too minor to require h5committest
Diffstat (limited to 'src/H5Osdspace.c')
-rw-r--r-- | src/H5Osdspace.c | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 0cfe6ba..8150a88 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -28,7 +28,7 @@ /* PRIVATE PROTOTYPES */ static void *H5O_sdspace_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh); static herr_t H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg); -static void *H5O_sdspace_copy(const void *_mesg, void *_dest); +static void *H5O_sdspace_copy(const void *_mesg, void *_dest, unsigned update_flags); static size_t H5O_sdspace_size(H5F_t *f, const void *_mesg); static herr_t H5O_sdspace_reset(void *_mesg); static herr_t H5O_sdspace_free (void *_mesg); @@ -56,7 +56,6 @@ const H5O_class_t H5O_SDSPACE[1] = {{ #define H5O_SDSPACE_VERSION 1 /* Is the interface initialized? */ -static int interface_initialize_g = 0; #define INTERFACE_INIT NULL /* Declare external the free list for H5S_extent_t's */ @@ -100,7 +99,7 @@ H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p, H5O_shared_ unsigned i; /* local counting variable */ unsigned flags, version; - FUNC_ENTER_NOAPI(H5O_sdspace_decode, NULL); + FUNC_ENTER_NOAPI_NOINIT(H5O_sdspace_decode); /* check args */ assert(f); @@ -192,9 +191,8 @@ H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *mesg) const H5S_extent_t *sdim = (const H5S_extent_t *) mesg; unsigned u; /* Local counting variable */ unsigned flags = 0; - herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_sdspace_encode, FAIL); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_encode); /* check args */ assert(f); @@ -224,8 +222,7 @@ H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *mesg) } } -done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(SUCCEED); } @@ -245,13 +242,13 @@ done: allocating the destination structure if necessary. --------------------------------------------------------------------------*/ static void * -H5O_sdspace_copy(const void *mesg, void *dest) +H5O_sdspace_copy(const void *mesg, void *dest, unsigned UNUSED update_flags) { const H5S_extent_t *src = (const H5S_extent_t *) mesg; H5S_extent_t *dst = (H5S_extent_t *) dest; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5O_sdspace_copy, NULL); + FUNC_ENTER_NOAPI_NOINIT(H5O_sdspace_copy); /* check args */ assert(src); @@ -301,7 +298,7 @@ H5O_sdspace_size(H5F_t *f, const void *mesg) */ size_t ret_value = 8; - FUNC_ENTER_NOAPI(H5O_sdspace_size, 0); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_size); /* add in the dimension sizes */ ret_value += space->rank * H5F_SIZEOF_SIZE (f); @@ -309,7 +306,6 @@ H5O_sdspace_size(H5F_t *f, const void *mesg) /* add in the space for the maximum dimensions, if they are present */ ret_value += space->max ? space->rank * H5F_SIZEOF_SIZE (f) : 0; -done: FUNC_LEAVE_NOAPI(ret_value); } @@ -333,14 +329,12 @@ static herr_t H5O_sdspace_reset(void *_mesg) { H5S_extent_t *mesg = (H5S_extent_t*)_mesg; - herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_sdspace_reset, FAIL); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_reset); H5S_extent_release(mesg); -done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(SUCCEED); } @@ -361,16 +355,13 @@ done: static herr_t H5O_sdspace_free (void *mesg) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(H5O_sdspace_free, FAIL); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_free); assert (mesg); H5FL_FREE(H5S_extent_t,mesg); -done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(SUCCEED); } @@ -398,9 +389,8 @@ H5O_sdspace_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg, { const H5S_extent_t *sdim = (const H5S_extent_t *) mesg; unsigned u; /* local counting variable */ - herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_sdspace_debug, FAIL); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_debug); /* check args */ assert(f); @@ -435,6 +425,5 @@ H5O_sdspace_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg, } } /* end if */ -done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(SUCCEED); } |