|
ReXGlue SDK
|
#include <rex/kernel/guest_allocator.h>
Public Member Functions | |
| WorkspaceHeap (Key, GuestAddressSpace &memory, u32 base, u32 size) | |
| u32 | GetSize () const |
| u32 | GetAllocated () const |
| Result< u32 > | Allocate (u32 size, bool zero) override |
| void | Free (u32 address) override |
Static Public Member Functions | |
| static Result< std::unique_ptr< WorkspaceHeap > > | Create (GuestAddressSpace &memory, u32 size) |
| static u32 | ResolveSize (u32 header_size) |
Additional Inherited Members | |
| Protected Member Functions inherited from rex::NonCopyable | |
| NonCopyable (const NonCopyable &)=delete | |
| NonCopyable & | operator= (const NonCopyable &)=delete |
The title workspace, title memory the system uses on the title's behalf. Blocks are sized to the request and rounded to 16 bytes, so a freed block can be taken again by a request of its size.
| rex::kernel::WorkspaceHeap::WorkspaceHeap | ( | Key | , |
| GuestAddressSpace & | memory, | ||
| u32 | base, | ||
| u32 | size ) |
Wraps a committed range. Only Create can make the key.
|
nodiscardoverridevirtual |
Allocates bytes from the workspace.
| zero | True to zero the bytes. |
Implements rex::kernel::ITitleWorkspace.
|
staticnodiscard |
Reserves and commits the workspace range.
|
overridevirtual |
Frees an address from Allocate. An address outside the workspace, or one that is not a live block, is logged and ignored.
| address | The guest address, 0 for none. |
Implements rex::kernel::ITitleWorkspace.
|
nodiscard |
Returns the bytes held by live blocks.
|
staticnodiscard |
Resolves the workspace size of a title.
| header_size | The XEX workspace size, 0 when the header is missing. |