MCPcopy Create free account
hub / github.com/Bareflank/hypervisor / initialize_pool

Function initialize_pool

lib/tests/src/basic_page_pool_t/behavior.cpp:63–72  ·  view source on GitHub ↗

<!-- description --> @brief Sets up the mut_pool. Note that this similar to how the loader would set up the pool, but not the same. The loader's pages will be spare in their layout the virtual addresses of each page are based on their physical address as they are in the direct map. This spare nature of the pages is not a requirement of the page mut_pool. All the pool_t cares about is that it is gi

Source from the content-addressed store, hash-verified

61 /// @param mut_pool the pool to initialize
62 ///
63 constexpr void
64 initialize_pool(bsl::span<basic_page_pool_node_t> &mut_pool) noexcept
65 {
66 auto const size{(mut_pool.size() - bsl::safe_umx::magic_1()).checked()};
67 for (bsl::safe_idx mut_i{}; mut_i < size; ++mut_i) {
68 mut_pool.at_if(mut_i)->next = mut_pool.at_if(mut_i + bsl::safe_idx::magic_1());
69 }
70
71 mut_pool.back_if()->next = nullptr;
72 }
73
74 /// <!-- description -->
75 /// @brief Used to execute the actual checks. We put the checks in this

Callers 2

testsFunction · 0.70
behavior.cppFile · 0.70

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected