vm: initialize g_pages at vm::init

Can reduce compile time/overhead.
This commit is contained in:
Nekotekina 2020-12-13 15:38:50 +03:00
parent 09d293592e
commit 62fdcf50ea

View file

@ -78,7 +78,7 @@ namespace vm
atomic_t<u64, 64> g_range_lock_set[64]{}; atomic_t<u64, 64> g_range_lock_set[64]{};
// Memory pages // Memory pages
std::array<memory_page, 0x100000000 / 4096> g_pages{}; std::array<memory_page, 0x100000000 / 4096> g_pages;
std::pair<bool, u64> try_reservation_update(u32 addr) std::pair<bool, u64> try_reservation_update(u32 addr)
{ {
@ -1636,6 +1636,8 @@ namespace vm
g_stat_addr, g_stat_addr + UINT32_MAX, g_stat_addr, g_stat_addr + UINT32_MAX,
g_reservations, g_reservations + sizeof(g_reservations) - 1); g_reservations, g_reservations + sizeof(g_reservations) - 1);
std::memset(&g_pages, 0, sizeof(g_pages));
g_locations = g_locations =
{ {
std::make_shared<block_t>(0x00010000, 0x1FFF0000, 0x220), // main std::make_shared<block_t>(0x00010000, 0x1FFF0000, 0x220), // main