summaryrefslogtreecommitdiffstats
path: root/src/H5Bprivate.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-07-10 02:28:06 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-07-10 02:28:06 (GMT)
commit18c505c6756e4e1750343c6a99df13a5b6ee9c90 (patch)
treee704ec2f05ee0519fbc1b701a53366d0dcf53a53 /src/H5Bprivate.h
parent6baa1ca5d29fbb877ec8b9a9f193bb5ec1515636 (diff)
downloadhdf5-18c505c6756e4e1750343c6a99df13a5b6ee9c90.zip
hdf5-18c505c6756e4e1750343c6a99df13a5b6ee9c90.tar.gz
hdf5-18c505c6756e4e1750343c6a99df13a5b6ee9c90.tar.bz2
[svn-r8853] Purpose:
Code optimization Description: Refactor B-tree code to extract all common information for a B-tree into a shared structure that is pointed to by all the nodes in tree (instead of being included in each node). Also re-order B-tree node comparison checks for chunked datasets to check for >= the upper node first, since the comparison is a bit "heavy" and this check is more likely to succeed when you are adding records to the dataset. Platforms tested: Solaris 2.7 (arabica) FreeBSD 4.10 (sleipnir) w/parallel Too minor to require h5committest (also, recent h5dump commits have broken testing...)
Diffstat (limited to 'src/H5Bprivate.h')
-rw-r--r--src/H5Bprivate.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h
index 4cf558a..2dfd0e1 100644
--- a/src/H5Bprivate.h
+++ b/src/H5Bprivate.h
@@ -34,6 +34,7 @@
#include "H5private.h" /* Generic Functions */
#include "H5ACprivate.h" /* Metadata cache */
#include "H5Fprivate.h" /* File access */
+#include "H5RCprivate.h" /* Reference counted object functions */
/*
* Feature: Define this constant if you want to check B-tree consistency
@@ -72,6 +73,18 @@ typedef int (*H5B_operator_t)(H5F_t *f, hid_t, void *_lt_key, haddr_t addr,
/* Typedef for B-tree in memory (defined in H5Bpkg.h) */
typedef struct H5B_t H5B_t;
+/* Each B-tree has certain information that can be shared across all
+ * the instances of nodes in that B-tree.
+ */
+typedef struct H5B_shared_t {
+ const struct H5B_class_t *type; /* Type of tree */
+ size_t sizeof_rkey; /* Size of raw (disk) key */
+ size_t sizeof_rnode; /* Size of raw (disk) node */
+ size_t sizeof_keys; /* Size of native (memory) key node */
+ uint8_t *page; /* Disk page */
+ size_t *nkey; /* Offsets of each native key in native key buffer */
+} H5B_shared_t;
+
/*
* Each class of object that can be pointed to by a B-link tree has a
* variable of this type that contains class variables and methods. Each
@@ -84,7 +97,7 @@ typedef struct H5B_class_t {
H5B_subid_t id; /*id as found in file*/
size_t sizeof_nkey; /*size of native (memory) key*/
size_t (*get_sizeof_rkey)(H5F_t*, const void*); /*raw key size */
- void * (*get_page)(H5F_t*, const void*); /*raw disk page for node */
+ H5RC_t * (*get_shared)(H5F_t*, const void*); /*shared info for node */
herr_t (*new_node)(H5F_t*, hid_t, H5B_ins_t, void*, void*, void*, haddr_t*);
int (*cmp2)(H5F_t*, hid_t, void*, void*, void*); /*compare 2 keys */
int (*cmp3)(H5F_t*, hid_t, void*, void*, void*); /*compare 3 keys */