From c4609c92eea30558473f02082733c7e59c2d2013 Mon Sep 17 00:00:00 2001 From: Markus Wick Date: Sat, 5 Jun 2021 11:47:08 +0200 Subject: common/host_memory: Optimize for huge tables. In theory, if we have 2 MB continously mapped, this should save one layer of TLB. Let's make it at least more likely by aligning the memory. --- src/common/host_memory.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/common/host_memory.h') diff --git a/src/common/host_memory.h b/src/common/host_memory.h index 98005df7a..eaa7d18ab 100644 --- a/src/common/host_memory.h +++ b/src/common/host_memory.h @@ -15,7 +15,7 @@ namespace Common { */ class HostMemory { public: - explicit HostMemory(size_t backing_size, size_t virtual_size); + explicit HostMemory(size_t backing_size_, size_t virtual_size_); ~HostMemory(); /** @@ -52,11 +52,15 @@ public: } private: + size_t backing_size{}; + size_t virtual_size{}; + // Low level handler for the platform dependent memory routines class Impl; std::unique_ptr impl; u8* backing_base{}; u8* virtual_base{}; + size_t virtual_base_offset{}; }; } // namespace Common -- cgit v1.2.3