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

Function collectMappings

src/e9patch/e9mapping.cpp:582–606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

580 */
581template <typename Key>
582static void collectMappings(Radix::Node<Key> *node, MappingSet &mappings)
583{
584 if (node == nullptr)
585 return;
586 if (!node->inner)
587 {
588 for (auto mapping = node->leaf.mappings; mapping != nullptr;
589 mapping = mapping->next)
590 {
591 std::string str;
592 bitstring(node->key, str);
593 log(COLOR_NONE, '[');
594 log(COLOR_YELLOW, str.c_str());
595 log(COLOR_NONE, ']');
596 insertMapping(mapping, mappings);
597 stat_num_physical_mappings++;
598 }
599 }
600 else
601 {
602 for (unsigned i = 0; i < BRANCH_MAX; i++)
603 collectMappings(node->child[i], mappings);
604 }
605 delete node;
606}
607
608/*
609 * Shrink a mapping (if possible).

Callers 1

optimizeMappingsFunction · 0.85

Calls 3

bitstringFunction · 0.85
logFunction · 0.85
insertMappingFunction · 0.85

Tested by

no test coverage detected