Changeset 252127e in mainline for generic/src/adt/btree.c


Ignore:
Timestamp:
2006-04-03T22:15:56Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b26db0c
Parents:
b9b14a83
Message:

Deploy B+tree in address space area management.
Change as_remap() to check for conflicts with other address space areas only when the area in question grows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/adt/btree.c

    rb9b14a83 r252127e  
    341341}
    342342
     343/** Return pointer to B-tree node's left sibling.
     344 *
     345 * @param t B-tree.
     346 * @param node Node whose left sibling will be returned.
     347 *
     348 * @return Left sibling of the node or NULL if the node does not have the left sibling.
     349 */
     350btree_node_t *btree_node_left_sibling(btree_t *t, btree_node_t *node)
     351{
     352        ASSERT(LEAF_NODE(node));
     353        if (node->leaf_link.prev != &t->leaf_head)
     354                return list_get_instance(node->leaf_link.prev, btree_node_t, leaf_link);
     355        else
     356                return NULL;
     357}
     358
     359/** Return pointer to B-tree node's right sibling.
     360 *
     361 * @param t B-tree.
     362 * @param node Node whose right sibling will be returned.
     363 *
     364 * @return Right sibling of the node or NULL if the node does not have the right sibling.
     365 */
     366btree_node_t *btree_node_right_sibling(btree_t *t, btree_node_t *node)
     367{
     368        ASSERT(LEAF_NODE(node));
     369        if (node->leaf_link.next != &t->leaf_head)
     370                return list_get_instance(node->leaf_link.next, btree_node_t, leaf_link);
     371        else
     372                return NULL;
     373}
     374
    343375/** Initialize B-tree node.
    344376 *
Note: See TracChangeset for help on using the changeset viewer.