Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
b3257f90
Commit
b3257f90
authored
Mar 10, 2008
by
Yoni Fogel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
7ebfaad0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
src/range_tree/tokuredblack.c
src/range_tree/tokuredblack.c
+8
-8
src/range_tree/tokuredblack.h
src/range_tree/tokuredblack.h
+4
-1
No files found.
src/range_tree/tokuredblack.c
View file @
b3257f90
...
...
@@ -59,9 +59,9 @@ static struct toku_rbt_node* toku_rbt__insert(
static
struct
toku_rbt_node
*
toku_rbt__lookup
(
int
,
const
toku_range
*
,
struct
toku_rbt_tree
*
,
struct
toku_rbt_node
**
);
static
void
toku_rbt__destroy
(
struct
toku_rbt_node
*
);
static
void
toku_rbt__destroy
(
struct
toku_rbt_
tree
*
rbinfo
,
struct
toku_rbt_
node
*
);
static
void
toku_rbt__delete
(
struct
toku_rbt_node
**
,
struct
toku_rbt_node
*
);
static
void
toku_rbt__delete
(
struct
toku_rbt_
tree
*
rbinfo
,
struct
toku_rbt_
node
**
,
struct
toku_rbt_node
*
);
static
void
toku_rbt__delete_fix
(
struct
toku_rbt_node
**
,
struct
toku_rbt_node
*
);
/*
...
...
@@ -132,7 +132,7 @@ toku_rbt_destroy(struct toku_rbt_tree *rbinfo)
return
;
if
(
rbinfo
->
rb_root
!=
RBNULL
)
toku_rbt__destroy
(
rbinfo
->
rb_root
);
toku_rbt__destroy
(
rbinfo
,
rbinfo
->
rb_root
);
rbinfo
->
rb_free
(
rbinfo
);
}
...
...
@@ -141,7 +141,7 @@ int toku_rbt_finger_delete(struct toku_rbt_node* node, struct toku_rbt_tree *rbi
int
r
=
ENOSYS
;
if
(
!
rbinfo
||
!
node
||
node
==
RBNULL
)
{
r
=
EINVAL
;
goto
cleanup
;
}
toku_rbt__delete
(
&
rbinfo
->
rb_root
,
node
);
toku_rbt__delete
(
rbinfo
,
&
rbinfo
->
rb_root
,
node
);
r
=
0
;
cleanup:
return
r
;
...
...
@@ -424,14 +424,14 @@ toku_rbt__lookup(int mode, const toku_range *key, struct toku_rbt_tree *rbinfo,
* only useful as part of a complete tree destroy.
*/
static
void
toku_rbt__destroy
(
struct
toku_rbt_node
*
x
)
toku_rbt__destroy
(
struct
toku_rbt_
tree
*
rbinfo
,
struct
toku_rbt_
node
*
x
)
{
if
(
x
!=
RBNULL
)
{
if
(
x
->
left
!=
RBNULL
)
toku_rbt__destroy
(
x
->
left
);
toku_rbt__destroy
(
rbinfo
,
x
->
left
);
if
(
x
->
right
!=
RBNULL
)
toku_rbt__destroy
(
x
->
right
);
toku_rbt__destroy
(
rbinfo
,
x
->
right
);
toku_rbt__free
(
rbinfo
,
x
);
}
}
...
...
@@ -642,7 +642,7 @@ const toku_range* toku_rbt_finger_insert(
/* Delete the node z, and free up the space
*/
static
void
toku_rbt__delete
(
struct
toku_rbt_node
**
rootp
,
struct
toku_rbt_node
*
z
)
toku_rbt__delete
(
struct
toku_rbt_
tree
*
rbinfo
,
struct
toku_rbt_
node
**
rootp
,
struct
toku_rbt_node
*
z
)
{
struct
toku_rbt_node
*
x
,
*
y
;
...
...
src/range_tree/tokuredblack.h
View file @
b3257f90
...
...
@@ -53,7 +53,10 @@ struct toku_rbt_tree {
int
toku_rbt_init
(
int
(
*
cmp
)(
const
toku_range
*
,
const
toku_range
*
),
struct
toku_rbt_tree
**
ptree
struct
toku_rbt_tree
**
ptree
,
void
*
(
*
user_malloc
)
(
size_t
),
void
(
*
user_free
)
(
void
*
),
void
*
(
*
user_realloc
)(
void
*
,
size_t
)
);
int
toku_rbt_lookup
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment