![]() |
mutable
A Database System for Research and Fast Prototyping
|
This is the common interface for all memory allocators that support rewiring. More...
#include <memory.hpp>
Public Member Functions | |
Allocator () | |
virtual | ~Allocator () |
int | fd () const |
Return the file descriptor of the underlying memory file. | |
virtual Memory | allocate (std::size_t size)=0 |
Creates a new memory object with size bytes of freshly allocated memory. | |
Protected Member Functions | |
virtual void | deallocate (Memory &&mem)=0 |
Deallocates a memory object. | |
Memory | create_memory (void *addr, std::size_t size, std::size_t offset) |
Helper method to inherit the friend ability to construct a Memory object. | |
Private Attributes | |
int | fd_ |
file descriptor of the underlying memory file | |
Friends | |
struct | Memory |
This is the common interface for all memory allocators that support rewiring.
Definition at line 17 of file memory.hpp.
Allocator::Allocator | ( | ) |
Definition at line 31 of file memory.cpp.
References fd_.
|
virtual |
Definition at line 45 of file memory.cpp.
References fd_.
|
pure virtual |
Creates a new memory object with size
bytes of freshly allocated memory.
Implemented in m::memory::LinearAllocator.
Referenced by m::wasm::Module::Memory().
|
protected |
Helper method to inherit the friend ability to construct a Memory
object.
Definition at line 50 of file memory.cpp.
References Memory.
Referenced by m::memory::LinearAllocator::allocate().
|
protectedpure virtual |
Deallocates a memory object.
Implemented in m::memory::LinearAllocator.
|
inline |
Return the file descriptor of the underlying memory file.
Definition at line 29 of file memory.hpp.
Referenced by m::memory::LinearAllocator::allocate(), m::memory::LinearAllocator::deallocate(), and m::memory::Memory::dump().
Definition at line 19 of file memory.hpp.
Referenced by m::memory::LinearAllocator::allocate(), and create_memory().
|
private |
file descriptor of the underlying memory file
Definition at line 22 of file memory.hpp.
Referenced by Allocator(), and ~Allocator().