summaryrefslogtreecommitdiffstats
path: root/src/common/virtual_buffer.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-03-19common: Reduce unused includesameerj1-1/+0
2020-12-30core/memory: Read and write page table atomicallyReinUsesLisp1-4/+6
Squash attributes into the pointer's integer, making them an uintptr_t pair containing 2 bits at the bottom and then the pointer. These bits are currently unused thanks to alignment requirements. Configure Dynarmic to mask out these bits on pointer reads. While we are at it, remove some unused attributes carried over from Citra. Read/Write and other hot functions use a two step unpacking process that is less readable to stop MSVC from emitting an extra AND instruction in the hot path: mov rdi,rcx shr rdx,0Ch mov r8,qword ptr [rax+8] mov rax,qword ptr [r8+rdx*8] mov rdx,rax -and al,3 and rdx,0FFFFFFFFFFFFFFFCh je Core::Memory::Memory::Impl::Read<unsigned char> mov rax,qword ptr [vaddr] movzx eax,byte ptr [rdx+rax]
2020-11-19virtual_buffer: Do nothing on resize() calls with same sizesLioncash1-1/+6
Prevents us from churning memory by freeing and reallocating a memory block that would have already been adequate as is.
2020-11-18virtual_buffer: Add compile-time type-safety guarantees with VirtualBufferLioncash1-0/+6
VirtualBuffer makes use of VirtualAlloc (on Windows) and mmap() (on other platforms). Neither of these ensure that non-trivial objects are properly constructed in the allocated memory. To prevent potential undefined behavior occurring due to that, we can add a static assert to loudly complain about cases where that is done.
2020-11-18page_table: Allow page tables to be movedLioncash1-5/+18
Makes page tables and virtual buffers able to be moved, but not copied, making the interface more flexible. Previously, with the destructor specified, but no move assignment or constructor specified, they wouldn't be implicitly generated.
2020-08-15common: Make use of [[nodiscard]] where applicableLioncash1-5/+5
Now that clang-format makes [[nodiscard]] attributes format sensibly, we can apply them to several functions within the common library to allow the compiler to complain about any misuses of the functions.
2020-04-17common: Add VirtualBuffer class, to abstract memory virtualization.bunnei1-0/+58