diff options
| author | 2021-06-05 11:47:08 +0200 | |
|---|---|---|
| committer | 2021-06-11 17:27:06 +0200 | |
| commit | c4609c92eea30558473f02082733c7e59c2d2013 (patch) | |
| tree | 892e5381d772333548b827f9b0b728907bb68cc6 /src/common/host_memory.h | |
| parent | core: Make use of fastmem (diff) | |
| download | yuzu-c4609c92eea30558473f02082733c7e59c2d2013.tar.gz yuzu-c4609c92eea30558473f02082733c7e59c2d2013.tar.xz yuzu-c4609c92eea30558473f02082733c7e59c2d2013.zip | |
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.
Diffstat (limited to 'src/common/host_memory.h')
| -rw-r--r-- | src/common/host_memory.h | 6 |
1 files changed, 5 insertions, 1 deletions
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 { | |||
| 15 | */ | 15 | */ |
| 16 | class HostMemory { | 16 | class HostMemory { |
| 17 | public: | 17 | public: |
| 18 | explicit HostMemory(size_t backing_size, size_t virtual_size); | 18 | explicit HostMemory(size_t backing_size_, size_t virtual_size_); |
| 19 | ~HostMemory(); | 19 | ~HostMemory(); |
| 20 | 20 | ||
| 21 | /** | 21 | /** |
| @@ -52,11 +52,15 @@ public: | |||
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | private: | 54 | private: |
| 55 | size_t backing_size{}; | ||
| 56 | size_t virtual_size{}; | ||
| 57 | |||
| 55 | // Low level handler for the platform dependent memory routines | 58 | // Low level handler for the platform dependent memory routines |
| 56 | class Impl; | 59 | class Impl; |
| 57 | std::unique_ptr<Impl> impl; | 60 | std::unique_ptr<Impl> impl; |
| 58 | u8* backing_base{}; | 61 | u8* backing_base{}; |
| 59 | u8* virtual_base{}; | 62 | u8* virtual_base{}; |
| 63 | size_t virtual_base_offset{}; | ||
| 60 | }; | 64 | }; |
| 61 | 65 | ||
| 62 | } // namespace Common | 66 | } // namespace Common |