Quantum 3
3.0.9
The Quantum heap is a custom memory allocator that contains rollback-able memory allocations by Quantum user or internal systems. It implements the ITrackableFrameHeap interface for memory leak tracking. More...
Classes | |
| struct | Config |
| The configuration of the frame heap. More... | |
| struct | Stats |
| Statistics of the heap. More... | |
Public Member Functions | |
| void * | Allocate (Int32 size) |
| Allocate memory on the heap with a given size. More... | |
| void * | Allocate< T > (int size, T allocTracker) |
| Allocate memory on the heap. More... | |
| void * | AllocateAndClear (Int32 size) |
| Allocate memory on the heap with a given size and clear the memory. More... | |
| void * | AllocateAndClear< T > (int size, T allocTracker) |
| Allocate a void* with a given size and clear the memory. More... | |
| Ptr | AllocateAndClearPtr (Int32 size) |
| Allocate a Ptr of a given size and clear the memory. More... | |
| Ptr | AllocateAndClearPtr< T > (int size, T allocTracker) |
| Allocate a Ptr with a given size and clear the memory. More... | |
| Ptr | AllocatePtr (Int32 size) |
| Allocate a Ptr of a given size. More... | |
| Ptr | AllocatePtr< T > (int size, T allocTracker) |
| Allocate a Ptr with a given size. More... | |
| void * | Expand (void *buffer, Int32 currentSize, Int32 newSize) |
| Grow an allocated array and copy the content to the new array. More... | |
| void * | Expand< T > (void *buffer, int currentSize, int newSize, T allocTracker) |
| Grow an allocated array of type T. The content is copied to the new array. More... | |
| T * | ExpandArray< T > (T *buffer, Int32 currentSize, Int32 newSize) |
| Grow an allocated array of type T and copy the content to the new array. More... | |
| T * | ExpandArray< T, TTracker > (T *buffer, int currentSize, int newSize, TTracker allocTracker) |
| Grow an allocated array of type T. The content is copied to the new array. More... | |
| void | Free (Ptr ptr) |
| Free a Ptr from the heap memory. More... | |
| void | Free (void *ptr) |
| Free a block of memory from the heap. More... | |
| void | Free< T > (Ptr ptr, T allocTracker) |
| Free a ptr from the heap memory. More... | |
| void | Free< T > (void *ptr, T allocTracker) |
| Free a block of memory from the heap. More... | |
| void * | Void (Ptr p) |
| Converts a Ptr to a void pointer. More... | |
| Ptr | Void (void *ptr) |
| Converts a pointer to a Ptr. More... | |
| T * | Void< T > (Ptr p) |
| Converts a Ptr to a typed pointer. More... | |
Public Member Functions inherited from Quantum.Allocator.IFrameHeap | |
| void * | Allocate (int size) |
| Allocates a block of memory of the specified size. More... | |
| void * | AllocateAndClear (int size) |
| Allocates a block of memory of the specified size and clears it. More... | |
| Ptr | AllocateAndClearPtr (int size) |
| Allocates a Ptr for a block of memory of the specified size and clears it. More... | |
| Ptr | AllocatePtr (int size) |
| Allocates a Ptr for a block of memory of the specified size. More... | |
| void * | Expand (void *buffer, int currentSize, int newSize) |
| Expands a memory block in the given buffer to the specified new size. More... | |
| T * | ExpandArray< T > (T *buffer, int currentSize, int newSize) |
| Expands an array in the given buffer to the specified new size. More... | |
| TPtr * | Void< TPtr > (Ptr p) |
| Converts a Ptr to a typed pointer. More... | |
Static Public Member Functions | |
| static byte[] | Blit (Heap *heap) |
| Obsolete. More... | |
| static void | Blit (Heap *heap, byte[] byteBlocks, Native.Allocator allocator) |
| Obsolete. More... | |
| static void | Copy (Native.Allocator allocator, Heap *to, Heap *from) |
| Copies the complete frame heap from one heap to another. More... | |
| static ulong | CRC (ulong crc, Heap *heap) |
| Obsolete. More... | |
| static Stats | GetStats (Heap *heap) |
| Generates a compact statistic report about the memory usage. More... | |
| static void | Print (Heap *heap, FramePrinter printer) |
| Prints the frame heap using a FramePrinter. More... | |
| static void | Reset () |
| Reset the heap. More... | |
Properties | |
| readonly byte * | Memory [get] |
| Get direct access to the memory of the heap. More... | |
| bool? | Reserved [get, set] |
| Set and get the reserved flag. More... | |
| readonly int | Size [get] |
| Returns the heap size set by the Heap.Config.HEAP_SIZE. More... | |
The Quantum heap is a custom memory allocator that contains rollback-able memory allocations by Quantum user or internal systems. It implements the ITrackableFrameHeap interface for memory leak tracking.
|
inline |
Allocate a Ptr with a given size.
| T | Tracker type |
| size | Allocation size |
| allocTracker | Alloc tracker instance |
Implements Quantum.Allocator.ITrackableFrameHeap.
| T | : | IHeapAllocationTracker |
|
inline |
Allocate a Ptr with a given size and clear the memory.
| T | Tracker type |
| size | Allocation size |
| allocTracker | Alloc tracker instance |
Implements Quantum.Allocator.ITrackableFrameHeap.
| T | : | IHeapAllocationTracker |
|
inline |
Allocate a void* with a given size and clear the memory.
| T | Tracker type |
| size | Allocation size |
| allocTracker | Alloc tracker instance |
Implements Quantum.Allocator.ITrackableFrameHeap.
| T | : | IHeapAllocationTracker |
|
inline |
Grow an allocated array of type T. The content is copied to the new array.
| T | Array type |
| TTracker | Tracker type |
| buffer | Array |
| currentSize | Current array size |
| newSize | New array size |
| allocTracker | Allocation tracker |
Implements Quantum.Allocator.ITrackableFrameHeap.
| T | : | unmanaged | |
| TTracker | : | IHeapAllocationTracker |
|
inline |
Grow an allocated array of type T. The content is copied to the new array.
| T | Tacker type |
| buffer | Array |
| currentSize | Current array size |
| newSize | New array size |
| allocTracker | Allocation tracker |
Implements Quantum.Allocator.ITrackableFrameHeap.
| T | : | IHeapAllocationTracker |
|
inline |
Allocate memory on the heap.
| T | Tracker type |
| size | Allocation size |
| allocTracker | Alloc tracker |
| ArgumentException | Allocated size is larger than the max size defined by the SimulationConfig. |
Implements Quantum.Allocator.ITrackableFrameHeap.
| T | : | IHeapAllocationTracker |
|
inline |
Allocate memory on the heap with a given size.
| size | Size in bytes |
|
inline |
Allocate a Ptr of a given size.
| size | Size |
|
inline |
Allocate memory on the heap with a given size and clear the memory.
| size | Size |
|
inline |
Allocate a Ptr of a given size and clear the memory.
| size | Size |
|
inline |
Grow an allocated array of type T and copy the content to the new array.
| T | Array type |
| buffer | Array |
| currentSize | Current array size |
| newSize | New array size |
| T | : | unmanaged |
|
inline |
Grow an allocated array and copy the content to the new array.
| buffer | Array |
| currentSize | Current array size |
| newSize | New array size |
|
inlinestatic |
Reset the heap.
|
inlinestatic |
Obsolete.
|
inlinestatic |
Obsolete.
|
inlinestatic |
Obsolete.
Generates a compact statistic report about the memory usage.
| heap | Pointer to heap to analyze. |
|
inlinestatic |
Copies the complete frame heap from one heap to another.
| allocator | Allocator instance |
| to | Destination heap |
| from | Source heap |
| InvalidOperationException | Is thrown when the heaps have different configurations. |
|
inlinestatic |
Prints the frame heap using a FramePrinter.
| heap | Pointer to heap instance |
| printer | Printer object |
|
inline |
Free a ptr from the heap memory.
| T | Type of allocation tracker |
| ptr | Ptr |
| allocTracker | Allocation tracker instance |
Implements Quantum.Allocator.ITrackableFrameHeap.
| T | : | IHeapAllocationTracker |
|
inline |
Free a block of memory from the heap.
| T | Type of allocation tracker |
| ptr | Memory to free |
| allocTracker | Allocation tracker instance |
Implements Quantum.Allocator.ITrackableFrameHeap.
| T | : | IHeapAllocationTracker |
|
inline |
Free a block of memory from the heap.
| ptr | Memory block |
Implements Quantum.Allocator.IFrameHeap.
|
inline |
|
inline |
Converts a pointer to a Ptr.
| ptr | Void pointer |
Implements Quantum.Allocator.IFrameHeap.
|
inline |
Converts a Ptr to a void pointer.
| p | Ptr |
Implements Quantum.Allocator.IFrameHeap.
|
inline |
Converts a Ptr to a typed pointer.
| T | Type of pointer |
| p | Ptr |
| T | : | unmanaged |
|
getset |
Set and get the reserved flag.
|
get |
Get direct access to the memory of the heap.
|
get |
Returns the heap size set by the Heap.Config.HEAP_SIZE.