66 #define DATATREE_DEBUG 0 105 if (!current)
return 0;
106 result += splay_tree_count_size(current->
left);
107 result += splay_tree_count_size(current->
right);
116 return splay_tree_count_size(datacentric_tree_root);
137 if (datacentric_tree_root !=
NULL) {
139 datacentric_tree_root =
splay(datacentric_tree_root, memblock);
141 if (memblock < datacentric_tree_root->memblock) {
142 node->
left = datacentric_tree_root->
left;
145 }
else if (memblock > datacentric_tree_root->
memblock) {
151 datacentric_tree_root =
node;
169 if (datacentric_tree_root ==
NULL) {
175 datacentric_tree_root =
splay(datacentric_tree_root, memblock);
177 if (!datacentric_tree_root ||
178 memblock != datacentric_tree_root->
memblock) {
186 if (datacentric_tree_root->
left ==
NULL) {
187 datacentric_tree_root = datacentric_tree_root->
right;
192 datacentric_tree_root->
left =
splay(datacentric_tree_root->
left, memblock);
193 datacentric_tree_root->
left->
right = datacentric_tree_root->
right;
194 datacentric_tree_root = datacentric_tree_root->
left;
205 if(!datacentric_tree_root || !key) {
#define INTERVAL_SPLAY_TREE(type, root, key, start, end, left, right)
struct datatree_info_s * right
static void spinlock_unlock(spinlock_t *l)
#define REGULAR_SPLAY_TREE(type, root, key, value, left, right)
void datatree_splay_insert(struct datatree_info_s *node)
struct datatree_info_s * left
static struct datatree_info_s ** interval_splay(struct datatree_info_s **root, void *key, void **start, void **end)
struct datatree_info_s * datatree_splay_delete(void *memblock)
static struct datatree_info_s * splay(struct datatree_info_s *root, void *key)
static void DATACENTRIC()
static void spinlock_lock(spinlock_t *l)
static struct datatree_info_s * datacentric_tree_root
static spinlock_t datatree_lock
struct datatree_info_s * datatree_splay_lookup(void *key, void **start, void **end)
#define SPINLOCK_UNLOCKED