summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-04-28 14:41:07 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-04-28 14:41:07 (GMT)
commit8ae072d76010005276fabf71233fb299fb1bace6 (patch)
tree632206e8fcbaa809cde3ac89866fcfee91d7e410
parent808390dbd9b0ec8beed817121fdf0fd0aa25ff0a (diff)
downloadhdf5-8ae072d76010005276fabf71233fb299fb1bace6.zip
hdf5-8ae072d76010005276fabf71233fb299fb1bace6.tar.gz
hdf5-8ae072d76010005276fabf71233fb299fb1bace6.tar.bz2
[svn-r16869] Description:
Reduce overhead for func enter/leave & error handling macros. (Reduces object code size by ~20% for production/~10% for debug, with gcc) Tested on: Mac OS X/32 10.5.6 (amazon) (Too minor to require h5committest)
-rw-r--r--src/H5Eprivate.h2
-rw-r--r--src/H5private.h7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h
index 7b1d7ef..c6adb67 100644
--- a/src/H5Eprivate.h
+++ b/src/H5Eprivate.h
@@ -40,7 +40,7 @@ typedef struct H5E_t H5E_t;
*/
#define HCOMMON_ERROR(maj, min, str) \
HERROR(maj, min, str); \
- (void)H5E_dump_api_stack((hbool_t)H5_IS_API(FUNC));
+ err_occurred = TRUE;
/*
* HDONE_ERROR macro, used to facilitate error reporting between a
diff --git a/src/H5private.h b/src/H5private.h
index 7a7ec53..43b8a95 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -1741,6 +1741,7 @@ static herr_t H5_INTERFACE_INIT_FUNC(void);
#define FUNC_ENTER_COMMON(func_name,asrt) \
static const char FUNC[]=#func_name; \
+ hbool_t err_occurred = FALSE; \
FUNC_ENTER_COMMON_NOFUNC(func_name,asrt);
/* Threadsafety initialization code for API routines */
@@ -1910,7 +1911,9 @@ static herr_t H5_INTERFACE_INIT_FUNC(void);
#define FUNC_LEAVE_API(ret_value) \
FINISH_MPE_LOG; \
H5TRACE_RETURN(ret_value); \
- H5_POP_FUNC \
+ H5_POP_FUNC \
+ if(err_occurred) \
+ (void)H5E_dump_api_stack(TRUE); \
FUNC_LEAVE_API_THREADSAFE \
return (ret_value); \
} /*end scope from end of FUNC_ENTER*/ \
@@ -1919,6 +1922,8 @@ static herr_t H5_INTERFACE_INIT_FUNC(void);
#define FUNC_LEAVE_API_NOFS(ret_value) \
FINISH_MPE_LOG; \
H5TRACE_RETURN(ret_value); \
+ if(err_occurred) \
+ (void)H5E_dump_api_stack(TRUE); \
FUNC_LEAVE_API_THREADSAFE \
return (ret_value); \
} /*end scope from end of FUNC_ENTER*/ \