kernel/src/vm/MapTree.h
/**
         * Searches the subtree, rooted at `node`, for a virtual memory mapping that contains the
         * specified address.
         *
         * @param address Virtual address to find the responsible mapping for
         * @param outLeaf If specified, a varaible to store the tree node containing the entry
         * @param node Leaf at which we should begin the search
         *
         * @return Tree leaf corresponding to the mapping or `nullptr` if not found
         */
Searches the subtree, rooted at `node`, for a virtual memory mapping that contains the
specified address.

@param address Virtual address to find the responsible mapping for
@param outLeaf If specified, a varaible to store the tree node containing the entry
@param node Leaf at which we should begin the search

@return Tree leaf corresponding to the mapping or `nullptr` if not found
Searches the subtree rooted at ` node ` for a virtual memory mapping that contains the specified address . @param address Virtual address to find the responsible mapping for @param outLeaf If specified a varaible to store the tree node containing the entry @param node Leaf at which we should begin the search @return Tree leaf corresponding to the mapping or ` nullptr ` if not found
MapTreeLeaf *find(const uintptr_t address, MapTreeLeaf *node) {
            if(!node) return nullptr;
            else if(node->address == address) return node;
            if(address < node->address) {
                return this->find(address, node->left);
            }
            else {
                if(node->contains(address)) {
                    return node;
                }
                return this->find(address, node->right);
            }
        }
MapTreeLeaf * find ( const uintptr_t address , MapTreeLeaf * node ) { if ( ! node ) return nullptr ; else if ( node -> address == address ) return node ; if ( address < node -> address ) { return this -> find ( address , node -> left ) ; } else { if ( node -> contains ( address ) ) { return node ; } return this -> find ( address , node -> right ) ; } }
Searches the subtree, rooted at `node`, for a virtual memory mapping that contains the
 specified address.
Searches the subtree rooted at ` node ` for a virtual memory mapping that contains the specified address .
// address is smaller so there's no chance it can be in this node // address is greater than or equal; check if it's contained within // beyond the end of the node, so check the right subtree