summaryrefslogtreecommitdiffstats
path: root/src/H5FL.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-06-23 15:36:35 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-06-23 15:36:35 (GMT)
commit7c3df64cc4742c0316ca81aeef67bd95a5737c70 (patch)
treef6aa023c661a881b2495ea0be4e745b43eea091f /src/H5FL.c
parent19644d75931aaa79951830d85eda28de08f17180 (diff)
downloadhdf5-7c3df64cc4742c0316ca81aeef67bd95a5737c70.zip
hdf5-7c3df64cc4742c0316ca81aeef67bd95a5737c70.tar.gz
hdf5-7c3df64cc4742c0316ca81aeef67bd95a5737c70.tar.bz2
[svn-r8731] Purpose:
Code cleanup & minor optimization Description: Re-work the way interface initialization routines are specified in the library to avoid the overhead of checking for them in routines where there is no interface initialization routine. This cleans up warnings with gcc 3.4, reduces the library binary size a bit (about 2-3%) and should speedup the library's execution slightly. Platforms tested: FreeBSD 4.10 (sleipnir) w/gcc34 h5committest
Diffstat (limited to 'src/H5FL.c')
-rw-r--r--src/H5FL.c35
1 files changed, 30 insertions, 5 deletions
diff --git a/src/H5FL.c b/src/H5FL.c
index 1d844b2..b5261f7 100644
--- a/src/H5FL.c
+++ b/src/H5FL.c
@@ -26,6 +26,9 @@
* move frequently accessed free lists to the head of the queue.
*/
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5FL_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5FL_mask
@@ -37,9 +40,6 @@
#include "H5FLprivate.h" /* Free Lists */
#include "H5MMprivate.h" /* Memory management */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/*
* Private type definitions
*/
@@ -112,6 +112,31 @@ static herr_t H5FL_blk_gc_list(H5FL_blk_head_t *head);
H5FL_DEFINE(H5FL_blk_node_t);
+/*--------------------------------------------------------------------------
+NAME
+ H5FL_init_interface -- Initialize interface-specific information
+USAGE
+ herr_t H5FL_init_interface()
+
+RETURNS
+ Non-negative on success/Negative on failure
+DESCRIPTION
+ Initializes any interface-specific data or routines.
+
+--------------------------------------------------------------------------*/
+static herr_t
+H5FL_init_interface(void)
+{
+ herr_t ret_value=SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_init_interface)
+
+ /* Nothing currently... */
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FL_init_interface() */
+
+
/*-------------------------------------------------------------------------
* Function: H5FL_malloc
*
@@ -495,7 +520,7 @@ H5FL_reg_term(void)
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_reg_term)
- if (interface_initialize_g) {
+ if (H5_interface_initialize_g) {
/* Free the nodes on the garbage collection list, keeping nodes with allocations outstanding */
left=NULL;
while(H5FL_reg_gc_head.first!=NULL) {
@@ -525,7 +550,7 @@ H5FL_reg_term(void)
/* Point to the list of nodes left with allocations open, if any */
H5FL_reg_gc_head.first=left;
if (!left)
- interface_initialize_g = 0; /*this layer has reached its initial state*/
+ H5_interface_initialize_g = 0; /*this layer has reached its initial state*/
}
/* Terminating this layer never affects other layers; rather, other layers affect