![]() |
mutable
A Database System for Research and Fast Prototyping
|
This class represents a reserved address space in virtual memory. More...
#include <memory.hpp>
Public Member Functions | |
AddressSpace (std::size_t size) | |
~AddressSpace () | |
AddressSpace (const AddressSpace &)=delete | |
AddressSpace (AddressSpace &&other) | |
void * | addr () const |
Returns a pointer to the beginning of the virtual address space. | |
std::size_t | size () const |
Returns the size in bytes of the virtual address space. | |
template<typename T > | |
T | as () const |
Get a pointer to the beginning of the virtual address space, converted to type T . | |
Private Member Functions | |
AddressSpace () | |
Private Attributes | |
void * | addr_ |
pointer to the beginning of the virtual address space | |
std::size_t | size_ |
size in bytes of the address space | |
Friends | |
void | swap (AddressSpace &first, AddressSpace &second) |
This class represents a reserved address space in virtual memory.
It can be used to map the contents of memory::Memory
instances into one contiguous virtual address range.
Definition at line 44 of file memory.hpp.
|
inlineprivate |
Definition at line 57 of file memory.hpp.
AddressSpace::AddressSpace | ( | std::size_t | size | ) |
Definition at line 60 of file memory.cpp.
References addr_, m::Ceil_To_Next_Page(), size(), and size_.
AddressSpace::~AddressSpace | ( | ) |
Definition at line 71 of file memory.cpp.
|
delete |
|
inline |
Definition at line 62 of file memory.hpp.
References m::swap().
|
inline |
Returns a pointer to the beginning of the virtual address space.
Definition at line 65 of file memory.hpp.
Referenced by MockInterface::_load(), MockInterface::_store(), and LinearAllocator::raw_allocate().
Get a pointer to the beginning of the virtual address space, converted to type T
.
Definition at line 71 of file memory.hpp.
References m::T().
Referenced by m::memory::Memory::map().
|
inline |
Returns the size in bytes of the virtual address space.
Definition at line 67 of file memory.hpp.
Referenced by MockInterface::_load(), MockInterface::_store(), AddressSpace(), LinearAllocator::allocate(), m::memory::Memory::map(), m::wasm::Module::Memory(), LinearAllocator::pre_allocate(), and LinearAllocator::raw_allocate().
|
friend |
Definition at line 46 of file memory.hpp.
|
private |
pointer to the beginning of the virtual address space
Definition at line 53 of file memory.hpp.
Referenced by AddressSpace(), and ~AddressSpace().
|
private |
size in bytes of the address space
Definition at line 54 of file memory.hpp.
Referenced by AddressSpace(), and ~AddressSpace().