diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2025-04-09 18:05:15 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2025-04-09 18:05:15 +0200 |
| commit | 66bb1aeb89d7ee64cad83ab12208b221ce5e9731 (patch) | |
| tree | 21a6bdb48bcd5fd47ce4c1bd38fafaebf1f3d62a /src/include | |
| parent | 91848efa34e1191a7500b98948c4be26b1df0208 (diff) | |
| download | box64-66bb1aeb89d7ee64cad83ab12208b221ce5e9731.tar.gz box64-66bb1aeb89d7ee64cad83ab12208b221ce5e9731.zip | |
[DYNAREC] Improved handling of db_size rbtree
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/rbtree.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/include/rbtree.h b/src/include/rbtree.h index 0d267fde..2daecaaf 100644 --- a/src/include/rbtree.h +++ b/src/include/rbtree.h @@ -248,6 +248,29 @@ int rb_unset(rbtree_t* tree, uintptr_t start, uintptr_t end); * with the highest key value in the tree. * Return: The start value of the right-most node if the tree is not empty; otherwise, 0. */ + +uint64_t rb_inc(rbtree_t* tree, uintptr_t start, uintptr_t end); + +/** + * rb_inc() - Increment by 1 an address range in a red-black tree. Create the node if needed. + * @tree: Pointer to the red-black tree where the address range will be set. + * @start: The starting address of the range to be set. + * @end: The ending address of the range to be set. + * + * Returns the new value for the node + */ + + uint64_t rb_dec(rbtree_t* tree, uintptr_t start, uintptr_t end); + +/** + * rb_dec() - Decrement by 1 an address range in a red-black tree. Do not create the node not existant. Delete the node if data == 0. + * @tree: Pointer to the red-black tree where the address range will be set. + * @start: The starting address of the range to be set. + * @end: The ending address of the range to be set. + * + * Returns the new value for the node (or 0 if non-existant / removed) + */ + uintptr_t rb_get_righter(rbtree_t* tree); /** |