summaryrefslogtreecommitdiffstats
path: root/src/H5TBprivate.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-11-17 16:53:38 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-11-17 16:53:38 (GMT)
commit1878ad9c2cc038e1739887b12a26512daf76eefc (patch)
tree948052b3e450ede9f30c2c4db7ba6e6f0657bc53 /src/H5TBprivate.h
parent94b852d15a0e2a52251071929e451ea7af414108 (diff)
downloadhdf5-1878ad9c2cc038e1739887b12a26512daf76eefc.zip
hdf5-1878ad9c2cc038e1739887b12a26512daf76eefc.tar.gz
hdf5-1878ad9c2cc038e1739887b12a26512daf76eefc.tar.bz2
[svn-r9537] Purpose:
Code cleanup & optimizations Description: Clean up some of the code in attributes to avoid allocating memory and performing type conversions when the conversion is a noop. Avoid memory allocations of attribute data structures by switching to use library's free list memory allocator routines. Avoid memory allocations of object header continuation data structures by switching to use library's free list memory allocator routines. Rearrange threaded, balanced binary tree macros slightly to avoid some overhead. Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel Solaris 2.7 (arabica) Too minor to require h5committest
Diffstat (limited to 'src/H5TBprivate.h')
-rw-r--r--src/H5TBprivate.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/H5TBprivate.h b/src/H5TBprivate.h
index f66d87c..0e374e3 100644
--- a/src/H5TBprivate.h
+++ b/src/H5TBprivate.h
@@ -62,10 +62,11 @@ typedef int (*H5TB_cmp_t)(const void *k1, const void *k2, int cmparg);
# define Intern(n) ( LeftCnt(n) && RightCnt(n) )
# define UnBal(n) ( LeftCnt(n)>RightCnt(n) ? LEFT : \
LeftCnt(n)==RightCnt(n) ? 0 : RIGHT)
+# define UnBalanced(n) ( LeftCnt(n)!=RightCnt(n) ? 1 : 0)
# define Double(n) ( H5TB_DOUBLE & (n)->flags )
# define Other(side) ( LEFT + RIGHT - (side) )
-# define Delta(n,s) ( ( Heavy(n,s) ? 1 : -1 ) \
- * ( Double(n) ? 2 : UnBal(n) ? 1 : 0 ) )
+# define Weight(n) ( Double(n) ? 2 : UnBalanced(n) )
+# define Delta(n,s) ( Heavy(n,s) ? Weight(n) : -Weight(n) )
# define SetFlags(n,s,b,i) ( ( -2<(b) && (b)<2 ? 0 : H5TB_DOUBLE ) \
| ( 0>(b) ? H5TB_HEAVY(s) : (b)>0 ? H5TB_HEAVY(Other(s)) : 0 ) \
| ( (i) ? H5TB_INTERN : 0 ) )