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

Function insertLeftChild

src/e9patch/e9alloc.cpp:479–493  ·  view source on GitHub ↗

* Insert left-child helper. */

Source from the content-addressed store, hash-verified

477 * Insert left-child helper.
478 */
479static Node *insertLeftChild(Node *root, intptr_t lb, intptr_t ub, size_t size,
480 uint32_t flags)
481{
482 ub = std::min(ub, root->alloc.lb);
483 if ((intptr_t)size > ub - lb)
484 return nullptr;
485 flags = flag_set(flags, FLAG_UB,
486 (root->alloc.lb - ub < (ssize_t)PAGE_SIZE));
487 Node *n;
488 if (root->entry.left == nullptr)
489 n = root->entry.left = node(root, lb, ub, size, flags);
490 else
491 n = insert(root->entry.left, lb, ub, size, flags);
492 return n;
493}
494
495/*
496 * Insert right-child helper.

Callers 1

insertFunction · 0.85

Calls 2

nodeFunction · 0.85
insertFunction · 0.70

Tested by

no test coverage detected