|
|
@ -341,7 +341,7 @@ void insert_singleton(TreeAlloc **root_ptr, TreeAlloc *to_insert) { |
|
|
|
#endif |
|
|
|
*root_ptr = to_insert; |
|
|
|
to_insert->parent = NULL; |
|
|
|
repair_tree_after_insert(root_ptr, to_insert); |
|
|
|
to_insert->color = COLOR_BLACK; |
|
|
|
} |
|
|
|
|
|
|
|
void insert_right(TreeAlloc** root_ptr, TreeAlloc* to_insert, TreeAlloc* after) { |
|
|
@ -357,6 +357,7 @@ void insert_right(TreeAlloc** root_ptr, TreeAlloc* to_insert, TreeAlloc* after) |
|
|
|
} |
|
|
|
after->right = to_insert; |
|
|
|
to_insert->parent = after; |
|
|
|
to_insert->color = COLOR_RED; |
|
|
|
repair_tree_after_insert(root_ptr, to_insert); |
|
|
|
} |
|
|
|
|
|
|
@ -373,6 +374,7 @@ void insert_left(TreeAlloc** root_ptr, TreeAlloc* to_insert, TreeAlloc* before) |
|
|
|
} |
|
|
|
before->left = to_insert; |
|
|
|
to_insert->parent = before; |
|
|
|
to_insert->color = COLOR_RED; |
|
|
|
repair_tree_after_insert(root_ptr, to_insert); |
|
|
|
} |
|
|
|
|
|
|
|