Allocator interface used by Cohtml for all memory allocations. The user has to provide an object that imlements this interface. Memory allocations in Cohtml are tagged, so the user knows the relative distribution of memory among subsystems. More...
Public Member Functions | |
IAllocator () | |
virtual void * | Allocate (unsigned size, cohtml::MemTags::MemTagsType memtag)=0 |
Allocate size bytes. More... | |
virtual void * | Reallocate (void *ptr, unsigned size, cohtml::MemTags::MemTagsType memtag)=0 |
Reallocates the given area of memory. It must be previously allocated by Allocate. More... | |
virtual void | Deallocate (void *ptr, cohtml::MemTags::MemTagsType memtag)=0 |
Deallocates the memory previously allocated by Allocate. More... | |
virtual void * | AlignedAllocate (unsigned size, unsigned alignment, cohtml::MemTags::MemTagsType memtag)=0 |
Allocate size bytes whose alignment is specified by alignment. More... | |
virtual void | AlignedDeallocate (void *ptr, cohtml::MemTags::MemTagsType memtag)=0 |
Deallocates the memory previously allocated by AlignedAllocate. More... | |
virtual void * | VirtualAllocate (void *hint, unsigned size, int protection, int flags, cohtml::MemTags::MemTagsType memtag)=0 |
Reserves, commits, or changes the state of a memory region. More... | |
virtual bool | VirtualFree (void *ptr, unsigned size, int flags, cohtml::MemTags::MemTagsType memtag)=0 |
Releases and decommits a memory region. More... | |
virtual | ~IAllocator () |
Allocator interface used by Cohtml for all memory allocations. The user has to provide an object that imlements this interface. Memory allocations in Cohtml are tagged, so the user knows the relative distribution of memory among subsystems.
cohtml::IAllocator::IAllocator | ( | ) |
|
virtual |
|
pure virtual |
Allocate size bytes whose alignment is specified by alignment.
size | number of bytes to allocate |
alignment | specifies the alignment |
memtag | tag of the subsystem from which the request came |
|
pure virtual |
Deallocates the memory previously allocated by AlignedAllocate.
ptr | the pointer to the memory to deallocate |
memtag | tag of the subsystem from which the request came |
|
pure virtual |
Allocate size bytes.
size | the number of bytes to allocate |
memtag | tag of the subsystem from which the request came |
|
pure virtual |
Deallocates the memory previously allocated by Allocate.
ptr | the pointer to the memory to deallocate |
memtag | tag of the subsystem from which the request came |
|
pure virtual |
Reallocates the given area of memory. It must be previously allocated by Allocate.
ptr | the pointer to the memory area to be reallocated |
size | number of bytes to allocate |
memtag | tag of the subsystem from which the request came |
|
pure virtual |
Reserves, commits, or changes the state of a memory region.
hint | address of the region to allocate. Address is rounded down to the nearest page boundary. |
size | the size of the region, in bytes. |
protection | specifies a protection type for the memory region |
flags | type of the allocation (commit, reserve etc) |
memtag | tag of the subsystem from which the request came |
|
pure virtual |
Releases and decommits a memory region.
ptr | a pointer to the address of the memory region. |
size | the size of the region in bytes. |
flags | type of the allocation (decommit, release etc). |
memtag | tag of the subsystem from which the request came |