summaryrefslogtreecommitdiffstats
path: root/src/H5Opline.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-11-22 17:14:40 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-11-22 17:14:40 (GMT)
commit2cf4e3037702673813530c31e7983794faf2bac2 (patch)
tree163a3de8816f4d59fa0cdf2d4d7e0359dba15925 /src/H5Opline.c
parente99a1f7838d12cb734edf860b15da18d2e4e5f83 (diff)
downloadhdf5-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/H5Opline.c')
-rw-r--r--src/H5Opline.c52
1 files changed, 19 insertions, 33 deletions
diff --git a/src/H5Opline.c b/src/H5Opline.c
index 5240f72..e4101cd 100644
--- a/src/H5Opline.c
+++ b/src/H5Opline.c
@@ -31,14 +31,13 @@
#define PABLO_MASK H5O_pline_mask
/* Interface initialization */
-static int interface_initialize_g = 0;
#define INTERFACE_INIT NULL
#define H5O_PLINE_VERSION 1
static herr_t H5O_pline_encode (H5F_t *f, uint8_t *p, const void *mesg);
static void *H5O_pline_decode (H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
-static void *H5O_pline_copy (const void *_mesg, void *_dest);
+static void *H5O_pline_copy (const void *_mesg, void *_dest, unsigned update_flags);
static size_t H5O_pline_size (H5F_t *f, const void *_mesg);
static herr_t H5O_pline_reset (void *_mesg);
static herr_t H5O_pline_free (void *_mesg);
@@ -93,7 +92,7 @@ H5O_pline_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p,
unsigned version;
size_t i, j, n, name_length;
- FUNC_ENTER_NOAPI(H5O_pline_decode, NULL);
+ FUNC_ENTER_NOAPI_NOINIT(H5O_pline_decode);
/* check args */
assert(p);
@@ -184,9 +183,8 @@ H5O_pline_encode (H5F_t UNUSED *f, uint8_t *p/*out*/, const void *mesg)
size_t i, j, name_length;
const char *name=NULL;
H5Z_class_t *cls=NULL;
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5O_pline_encode, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_encode);
/* Check args */
assert (p);
@@ -229,8 +227,7 @@ H5O_pline_encode (H5F_t UNUSED *f, uint8_t *p/*out*/, const void *mesg)
UINT32ENCODE(p, 0);
}
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}
@@ -253,14 +250,14 @@ done:
*-------------------------------------------------------------------------
*/
static void *
-H5O_pline_copy (const void *_src, void *_dst/*out*/)
+H5O_pline_copy (const void *_src, void *_dst/*out*/, unsigned UNUSED update_flags)
{
const H5O_pline_t *src = (const H5O_pline_t *)_src;
H5O_pline_t *dst = (H5O_pline_t *)_dst;
size_t i;
- H5O_pline_t *ret_value = NULL;
+ H5O_pline_t *ret_value;
- FUNC_ENTER_NOAPI(H5O_pline_copy, NULL);
+ FUNC_ENTER_NOAPI_NOINIT(H5O_pline_copy);
if (!dst && NULL==(dst = H5FL_MALLOC (H5O_pline_t)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
@@ -330,15 +327,15 @@ static size_t
H5O_pline_size (H5F_t UNUSED *f, const void *mesg)
{
const H5O_pline_t *pline = (const H5O_pline_t*)mesg;
- size_t i, size, name_len;
+ size_t i, name_len;
const char *name = NULL;
H5Z_class_t *cls = NULL;
size_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5O_pline_size, 0);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_size);
/* Message header */
- size = 1 + /*version */
+ ret_value = 1 + /*version */
1 + /*number of filters */
6; /*reserved */
@@ -350,21 +347,17 @@ H5O_pline_size (H5F_t UNUSED *f, const void *mesg)
name_len = name ? HDstrlen(name)+1 : 0;
- size += 2 + /*filter identification number */
+ ret_value += 2 + /*filter identification number */
2 + /*name length */
2 + /*flags */
2 + /*number of client data values */
H5O_ALIGN(name_len); /*length of the filter name */
- size += pline->filter[i].cd_nelmts * 4;
+ ret_value += pline->filter[i].cd_nelmts * 4;
if (pline->filter[i].cd_nelmts % 2)
- size += 4;
+ ret_value += 4;
}
- /* Set return value */
- ret_value=size;
-
-done:
FUNC_LEAVE_NOAPI(ret_value);
}
@@ -389,9 +382,8 @@ H5O_pline_reset (void *mesg)
{
H5O_pline_t *pline = (H5O_pline_t*)mesg;
size_t i;
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5O_pline_reset, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_reset);
assert (pline);
@@ -403,8 +395,7 @@ H5O_pline_reset (void *mesg)
H5MM_xfree(pline->filter);
HDmemset(pline, 0, sizeof *pline);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}
@@ -425,16 +416,13 @@ done:
static herr_t
H5O_pline_free (void *mesg)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5O_pline_free, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_free);
assert (mesg);
H5FL_FREE(H5O_pline_t,mesg);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}
@@ -460,9 +448,8 @@ H5O_pline_debug (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg, FILE *
{
const H5O_pline_t *pline = (const H5O_pline_t *)mesg;
size_t i, j;
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5O_pline_debug, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_debug);
/* check args */
assert(f);
@@ -506,6 +493,5 @@ H5O_pline_debug (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg, FILE *
}
}
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}