page_table: Allow page tables to be moved
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.
This commit is contained in:
parent
3cfd962ef4
commit
b3c8997829
4 changed files with 30 additions and 9 deletions
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace Common {
|
||||
|
||||
void* AllocateMemoryPages(std::size_t size) {
|
||||
void* AllocateMemoryPages(std::size_t size) noexcept {
|
||||
#ifdef _WIN32
|
||||
void* base{VirtualAlloc(nullptr, size, MEM_COMMIT, PAGE_READWRITE)};
|
||||
#else
|
||||
|
@ -29,7 +29,7 @@ void* AllocateMemoryPages(std::size_t size) {
|
|||
return base;
|
||||
}
|
||||
|
||||
void FreeMemoryPages(void* base, [[maybe_unused]] std::size_t size) {
|
||||
void FreeMemoryPages(void* base, [[maybe_unused]] std::size_t size) noexcept {
|
||||
if (!base) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue