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

Function initialize_pool

lib/tests/mocks/basic_page_pool_t/behavior.cpp:56–65  ·  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 basic_page_pool_t care

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected