MCPcopy Create free account
hub / github.com/GJDuck/e9patch / insertRightChild

Function insertRightChild

src/e9patch/e9alloc.cpp:498–512  ·  view source on GitHub ↗

* Insert right-child helper. */

Source from the content-addressed store, hash-verified

496 * Insert right-child helper.
497 */
498static Node *insertRightChild(Node *root, intptr_t lb, intptr_t ub, size_t size,
499 uint32_t flags)
500{
501 lb = std::max(lb, root->alloc.ub);
502 if ((intptr_t)size > ub - lb)
503 return nullptr;
504 flags = flag_set(flags, FLAG_LB,
505 (lb - root->alloc.ub < (ssize_t)PAGE_SIZE));
506 Node *n;
507 if (root->entry.right == nullptr)
508 n = root->entry.right = node(root, lb, ub, size, flags);
509 else
510 n = insert(root->entry.right, lb, ub, size, flags);
511 return n;
512}
513
514/*
515 * Insert a new allocation or reservation into the interval tree node `root`.

Callers 1

insertFunction · 0.85

Calls 2

nodeFunction · 0.85
insertFunction · 0.70

Tested by

no test coverage detected