diff options
| author | 2021-01-01 02:54:01 -0800 | |
|---|---|---|
| committer | 2021-01-01 02:54:01 -0800 | |
| commit | eb318ffffc5007c35c42826e23945a82c24900b1 (patch) | |
| tree | 95a401077534f48f0e6a92a269321ff9ad7aec45 /src/common/virtual_buffer.h | |
| parent | Merge pull request #5239 from FearlessTobi/enable-translation (diff) | |
| parent | core/memory: Read and write page table atomically (diff) | |
| download | yuzu-eb318ffffc5007c35c42826e23945a82c24900b1.tar.gz yuzu-eb318ffffc5007c35c42826e23945a82c24900b1.tar.xz yuzu-eb318ffffc5007c35c42826e23945a82c24900b1.zip | |
Merge pull request #5249 from ReinUsesLisp/lock-free-pages
core/memory: Read and write page table atomically
Diffstat (limited to 'src/common/virtual_buffer.h')
| -rw-r--r-- | src/common/virtual_buffer.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/common/virtual_buffer.h b/src/common/virtual_buffer.h index 91d430036..fb1a6f81f 100644 --- a/src/common/virtual_buffer.h +++ b/src/common/virtual_buffer.h | |||
| @@ -15,10 +15,12 @@ void FreeMemoryPages(void* base, std::size_t size) noexcept; | |||
| 15 | template <typename T> | 15 | template <typename T> |
| 16 | class VirtualBuffer final { | 16 | class VirtualBuffer final { |
| 17 | public: | 17 | public: |
| 18 | static_assert( | 18 | // TODO: Uncomment this and change Common::PageTable::PageInfo to be trivially constructible |
| 19 | std::is_trivially_constructible_v<T>, | 19 | // using std::atomic_ref once libc++ has support for it |
| 20 | "T must be trivially constructible, as non-trivial constructors will not be executed " | 20 | // static_assert( |
| 21 | "with the current allocator"); | 21 | // std::is_trivially_constructible_v<T>, |
| 22 | // "T must be trivially constructible, as non-trivial constructors will not be executed " | ||
| 23 | // "with the current allocator"); | ||
| 22 | 24 | ||
| 23 | constexpr VirtualBuffer() = default; | 25 | constexpr VirtualBuffer() = default; |
| 24 | explicit VirtualBuffer(std::size_t count) : alloc_size{count * sizeof(T)} { | 26 | explicit VirtualBuffer(std::size_t count) : alloc_size{count * sizeof(T)} { |