rpcs3/Utilities/VirtualMemory.h

23 lines
567 B
C
Raw Normal View History

#pragma once
namespace memory_helper
{
/**
2016-06-27 16:34:08 +00:00
* Reserve `size` bytes of virtual memory and returns it.
* The memory should be commited before usage.
*/
2016-06-27 16:34:08 +00:00
void* reserve_memory(std::size_t size);
/**
2016-06-27 16:34:08 +00:00
* Commit `size` bytes of virtual memory starting at pointer.
* That is, bake reserved memory with physical memory.
* pointer should belong to a range of reserved memory.
*/
2016-06-27 16:34:08 +00:00
void commit_page_memory(void* pointer, std::size_t size);
/**
2016-06-27 16:34:08 +00:00
* Decommit all memory committed via commit_page_memory.
*/
2016-06-27 16:34:08 +00:00
void free_reserved_memory(void* pointer, std::size_t size);
}