Difference between revisions of "Unit HeapManager"

From Ultibo.org
Jump to: navigation, search
 
(22 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
----
 
----
  
''To be documented''
+
'''Ultibo Heap Manager Interface unit'''
  
 
=== Constants ===
 
=== Constants ===
 
----
 
----
  
''To be documented''
+
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Heap specific constants''' <code> HEAP_MIN_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>HEAP_MIN_BLOCK = 57;</code>
 +
| SizeOf(THeapBlock) + 1
 +
|-
 +
| <code>HEAP_MIN_BLOCK = 33;</code>
 +
| SizeOf(THeapBlock) + 1
 +
|-
 +
| <code>HEAP_MIN_ALIGN = 64;</code>
 +
| SizeOf(THeapBlock) * 2 Must be greater than or equal to HEAP_MIN_BLOCK, must be a power of 2
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Heap signature''' <code> HEAP_SIGNATURE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>HEAP_SIGNATURE = $E84DF600;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>HEAP_SIGNATURE_MASK = $FFFFFF00;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Heap block state''' <code> HEAP_STATE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>HEAP_STATE_FREE = 0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>HEAP_STATE_USED = 1;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>HEAP_STATE_MASK = $000000FF;</code>
 +
| &nbsp;
 +
|-
 +
| <code>HEAP_STATE_ALL  = 2;</code>
 +
| Only for use by GetHeapBlockCount/GetHeapBlockMin/GetHeapBlockMax
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Heap block flag''' <code> HEAP_FLAG_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>HEAP_FLAG_NORMAL = $00000000;</code>
 +
| A normal memory block
 +
|-
 +
| <code>HEAP_FLAG_SHARED = $00000001;</code>
 +
| A sharable memory block, usually marked as sharable in the page tables of the memory management unit
 +
|-
 +
| <code>HEAP_FLAG_LOCAL = $00000002;</code>
 +
| A local memory block with an affinity to a specific processor, usually marked as non global in the page tables of the memory management unit
 +
|-
 +
| <code>HEAP_FLAG_CODE = $00000004;</code>
 +
| A code memory block (with an optional affinity to a specific processor), usually marked as executable in the page tables of the memory management unit
 +
|-
 +
| <code>HEAP_FLAG_DEVICE = $00000008;</code>
 +
| A device memory block, usually marked as device memory in the page tables of the memory management unit
 +
|-
 +
| <code>HEAP_FLAG_NOCACHE = $00000010;</code>
 +
| A non cached memory block, usually marked as not cacheable in the page tables of the memory management unit
 +
|-
 +
| <code>HEAP_FLAG_NONSHARED = $00000020;</code>
 +
| A non shared memory block, usually marked as not shareable in the page tables of the memory management unit
 +
|-
 +
| <code>HEAP_FLAG_LOCKED = $00000040;</code>
 +
| A locked memory block (Not currently implemented in Ultibo)
 +
|-
 +
| <code>HEAP_FLAG_IRQ = $00000080;</code>
 +
| An IRQ allocatable memory block
 +
|-
 +
| <code>HEAP_FLAG_FIQ = $00000100;</code>
 +
| An FIQ allocatable memory block
 +
|-
 +
| <code>HEAP_FLAG_RECLAIM = $00000200;</code>
 +
| A reclaimable memory block (eg Disk Cache)(with a registered callback to reclaim as required for normal memory)
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>HEAP_FLAG_CUSTOM = $08000000;</code>
 +
| A custom flag reserved for non standard uses
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>HEAP_FLAG_ALL = $FFFFFFFF;</code>
 +
| Only for use by GetHeapBlockCount/GetHeapBlockMin/GetHeapBlockMax
 +
|-
 +
| <code>HEAP_FLAG_INVALID = $FFFFFFFF;</code>
 +
| Return value from MemFlags/IRQ/FIQ on invalid
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Heap small block''' <code> HEAP_SMALL_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>HEAP_SMALL_MIN = 56;</code>
 +
| SizeOf(THeapBlock) Minimum size of a small heap block
 +
|-
 +
| <code>HEAP_SMALL_MIN = 32;</code>
 +
| SizeOf(THeapBlock) Minimum size of a small heap block
 +
|-
 +
| <code>HEAP_SMALL_MAX = SIZE_4K;</code>
 +
| Maximum size of a small heap block
 +
|-
 +
| <code>HEAP_SMALL_ALIGN = 4;</code>
 +
| SizeOf(LongWord); Alignment for small heap blocks
 +
|-
 +
| <code>HEAP_SMALL_SHIFT = 2;</code>
 +
| Size to Index conversion (Divide by 4)
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>HEAP_SMALL_LOW = (HEAP_SMALL_MIN div HEAP_SMALL_ALIGN);</code>
 +
| 8 (32-bit) / 14 (64-bit)
 +
|-
 +
| <code>HEAP_SMALL_HIGH = (HEAP_SMALL_MAX div HEAP_SMALL_ALIGN);</code>
 +
| 1024
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Type definitions ===
 
=== Type definitions ===
 
----
 
----
  
''To be documented''
+
 
 +
'''Heap callback'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>THeapCallback = function(Size:PtrUInt):LongWord;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Heap block'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PHeapBlock = ^THeapBlock;</code>
 +
 
 +
<code>THeapBlock = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>Size:PtrUInt;</code>
 +
| Size of the Heap Block (including the size of this structure)
 +
|-
 +
| <code>State:LongWord;</code>
 +
| State of the Heap Block (eg HEAP_STATE_FREE)
 +
|-
 +
| <code>Flags:LongWord;</code>
 +
| Flags of the Heap Block (eg HEAP_FLAG_SHARED)
 +
|-
 +
| <code>Affinity:LongWord;</code>
 +
| CPU Affinity of the Heap Block (eg CPU_AFFINITY_0)
 +
|-
 +
| <code>Prev:PHeapBlock;</code>
 +
| Previous Heap Block in list
 +
|-
 +
| <code>Next:PHeapBlock;</code>
 +
| Next Heap Block in list
 +
|-
 +
| <code>PrevLink:PHeapBlock;</code>
 +
| Previous Free/Used Block in list
 +
|-
 +
| <code>NextLink:PHeapBlock;</code>
 +
| Next Free/Used Block in list
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Heap small blocks'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PSmallBlocks = ^TSmallBlocks;</code>
 +
 
 +
<code>TSmallBlocks = array[HEAP_SMALL_LOW..HEAP_SMALL_HIGH] of PHeapBlock;</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| &nbsp;
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Heap lock'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PHeapLock = ^THeapLock;</code>
 +
 
 +
<code>THeapLock = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>Lock:THandle;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>IRQLock:THandle;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FIQLock:THandle;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AcquireLock:function(Handle:THandle):LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReleaseLock:function(Handle:THandle):LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AcquireIRQLock:function(Handle:THandle):LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReleaseIRQLock:function(Handle:THandle):LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AcquireFIQLock:function(Handle:THandle):LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReleaseFIQLock:function(Handle:THandle):LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Heap statistics'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PHeapStatistics = ^THeapStatistics;</code>
 +
 
 +
<code>THeapStatistics = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''Get/Alloc/Realloc''
 +
|-
 +
| <code>GetCount:LongWord;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>AllocCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReallocCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetAlignedCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AllocAlignedCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReallocAlignedCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetSharedCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AllocSharedCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReallocSharedCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetLocalCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AllocLocalCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReallocLocalCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetCodeCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AllocCodeCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReallocCodeCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetDeviceCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AllocDeviceCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReallocDeviceCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetNoCacheCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AllocNoCacheCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReallocNoCacheCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetNonSharedCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AllocNonSharedCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReallocNonSharedCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetIRQCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AllocIRQCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReallocIRQCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetFIQCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AllocFIQCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReallocFIQCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Free''
 +
|-
 +
| <code>FreeCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FreeIRQCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FreeFIQCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FreeSizeCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Size''
 +
|-
 +
| <code>SizeCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SizeIRQCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SizeFIQCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Flags''
 +
|-
 +
| <code>FlagsCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FlagsIRQCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FlagsFIQCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Register''
 +
|-
 +
| <code>RegisterCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Reserve''
 +
|-
 +
| <code>ReserveCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Request''
 +
|-
 +
| <code>RequestCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RequestSharedCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RequestLocalCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RequestCodeCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RequestDeviceCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RequestNoCacheCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RequestNonSharedCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RequestIRQCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RequestFIQCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Get Internal''
 +
|-
 +
| <code>GetZeroCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetRemainCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetInvalidCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetUnavailableCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetAddFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetSplitFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetRemoveFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Realloc Internal''
 +
|-
 +
| <code>ReallocZeroCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReallocSmallerCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReallocLargerCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReallocReleaseCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReallocReleaseBytes:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReallocAddFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReallocSplitFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReallocRemoveFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''GetAligned Internal''
 +
|-
 +
| <code>GetAlignedZeroCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetAlignedRemainCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetAlignedInvalidCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetAlignedUndersizeCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetAlignedUnavailableCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetAlignedAddFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetAlignedSplitFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetAlignedRemoveFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetAlignedReleaseCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetAlignedReleaseBytes:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Free Internal''
 +
|-
 +
| <code>FreeInvalidCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FreeAddFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FreeMergeFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FreeRemoveFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Size Internal''
 +
|-
 +
| <code>SizeInvalidCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Flags Internal''
 +
|-
 +
| <code>FlagsInvalidCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Register Internal''
 +
|-
 +
| <code>RegisterInvalidCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RegisterAddFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Reserve Internal''
 +
|-
 +
| <code>ReserveInvalidCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReserveAddFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReserveSplitFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReserveRemoveFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ReserveUnavailableCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Request Internal''
 +
|-
 +
| <code>RequestInvalidCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RequestAddFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RequestSplitFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RequestRemoveFailCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RequestUnavailableCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Split Internal''
 +
|-
 +
| <code>SplitCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Merge Internal''
 +
|-
 +
| <code>MergePrevCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>MergeNextCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Block Internal''
 +
|-
 +
| <code>GetSmallCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GetLargeCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FindFreeCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AddSmallCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AddLargeCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RemoveSmallCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>RemoveLargeCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SmallUnavailableCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''Heap snapshot'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PHeapSnapshot = ^THeapSnapshot;</code>
 +
 
 +
<code>THeapSnapshot = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''Snapshot Properties''
 +
|-
 +
| <code>Address:PtrUInt;</code>
 +
| Address of the Heap Block
 +
|-
 +
| <code>Size:PtrUInt;</code>
 +
| Size of the Heap Block (including the size of the THeapBlock structure)
 +
|-
 +
| <code>State:LongWord;</code>
 +
| State of the Heap Block (eg HEAP_STATE_FREE)
 +
|-
 +
| <code>Flags:LongWord;</code>
 +
| Flags of the Heap Block (eg HEAP_FLAG_SHARED)
 +
|-
 +
| <code>Affinity:LongWord;</code>
 +
| CPU Affinity of the Heap Block (eg CPU_AFFINITY_0)
 +
|-
 +
|colspan="2"|''Internal Properties''
 +
|-
 +
| <code>Next:PHeapSnapshot;</code>
 +
| Next entry in Heap snapshot
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Public variables ===
 
=== Public variables ===
 
----
 
----
  
''To be documented''
+
''None defined''
  
 
=== Function declarations ===
 
=== Function declarations ===
Line 34: Line 670:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 46: Line 682:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function ReserveHeapBlock(Address:Pointer; Size:PtrUInt):Pointer;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Request the Heap Block specified by address and size be reserved from allocation</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Address
 +
| The starting address for the reservation. The memory manager may reserve a block that starts prior to the supplied address for alignment purposes.
 +
|-
 +
! Size
 +
| The total size in byte to be reserved, the memory manager may increase the amount reserved to cater for alignment or to prevent orphan blocks.
 +
Size must be greater than 0.
 +
|-
 +
! Return
 +
| A pointer to the actual reserved memory which may differ from the supplied starting address due to alignment. The reservation can be cancelled by passing the returned pointer to FreeMem.
 
|-
 
|-
 
|}
 
|}
Line 58: Line 713:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Hint'''
+
! Hint
 
| The hint provides the requested base address of the heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil if any heap block is suitable
 
| The hint provides the requested base address of the heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil if any heap block is suitable
 
|-
 
|-
! '''Size'''
+
! Size
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT. Flags provides the heap block flags such as shared, local, code, device, nocache etc.
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT. Flags provides the heap block flags such as shared, local, code, device, nocache etc.
 
|-
 
|-
! '''Affinity'''
+
! Affinity
 
| The affinity provides the processor affinity mask, a mask of 0 indicates no specific processor
 
| The affinity provides the processor affinity mask, a mask of 0 indicates no specific processor
 
|-
 
|-
! '''Return'''
+
! Return
 
| The return is the heap block that has been registered or nil if the request failed
 
| The return is the heap block that has been registered or nil if the request failed
 
|-
 
|-
! '''Note'''
+
! Note
| To allocate this memory use GetMemEx / AllocMemEx etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
+
| To allocate this memory use GetMemEx/AllocMemEx etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
 
|-
 
|-
 
|}
 
|}
Line 82: Line 737:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Hint'''
+
! Hint
 
| The hint provides the requested base address of the shared heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil if any heap block is suitable
 
| The hint provides the requested base address of the shared heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil if any heap block is suitable
 
|-
 
|-
! '''Size'''
+
! Size
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT.
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT.
 
|-
 
|-
! '''Return'''
+
! Return
 
| The return is the heap block that has been marked as shared or nil if the request failed (the memory management unit should mark this region of memory as sharable)
 
| The return is the heap block that has been marked as shared or nil if the request failed (the memory management unit should mark this region of memory as sharable)
 
|-
 
|-
! '''Note'''
+
! Note
| To allocate shared memory use GetSharedMem / AllocSharedMem etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
+
| To allocate shared memory use GetSharedMem/AllocSharedMem etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
 
|-
 
|-
 
|}
 
|}
Line 103: Line 758:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Hint'''
+
! Hint
 
| The hint provides a requested base address of the local heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil  if any heap block is suitable
 
| The hint provides a requested base address of the local heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil  if any heap block is suitable
 
|-
 
|-
! '''Size'''
+
! Size
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT.
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT.
 
|-
 
|-
! '''Affinity'''
+
! Affinity
 
| The affinity provides the processor affinity mask, a mask of 0 indicates no specific processor
 
| The affinity provides the processor affinity mask, a mask of 0 indicates no specific processor
 
|-
 
|-
! '''Return'''
+
! Return
 
| The return is the heap block that has been marked as local or nil if the request failed (The memory management unit should mark this region of memory as local or non global)
 
| The return is the heap block that has been marked as local or nil if the request failed (The memory management unit should mark this region of memory as local or non global)
 
|-
 
|-
! '''Note'''
+
! Note
| To allocate local memory use GetLocalMem / AllocLocalMem etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
+
| To allocate local memory use GetLocalMem/AllocLocalMem etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
 
|-
 
|-
 
|}
 
|}
Line 127: Line 782:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Hint'''
+
! Hint
 
| The hint provides a requested base address of the code heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil if any heap block is suitable
 
| The hint provides a requested base address of the code heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil if any heap block is suitable
 
|-
 
|-
! '''Size'''
+
! Size
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT.
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT.
 
|-
 
|-
! '''Affinity'''
+
! Affinity
 
| The affinity provides the processor affinity mask, a mask of 0 indicates no specific processor
 
| The affinity provides the processor affinity mask, a mask of 0 indicates no specific processor
 
|-
 
|-
! '''Return'''
+
! Return
 
| The return is the heap block that has been marked as code or nil if the request failed (The memory management unit should mark this region of memory as executable)
 
| The return is the heap block that has been marked as code or nil if the request failed (The memory management unit should mark this region of memory as executable)
 
|-
 
|-
! '''Note'''
+
! Note
| To allocate code memory use GetCodeMem / AllocCodeMem etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
+
| To allocate code memory use GetCodeMem/AllocCodeMem etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
 
|-
 
|-
 
|}
 
|}
Line 151: Line 806:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Hint'''
+
! Hint
 
| The hint provides the requested base address of the device heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil if any heap block is suitable
 
| The hint provides the requested base address of the device heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil if any heap block is suitable
 
|-
 
|-
! '''Size'''
+
! Size
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT.
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT.
 
|-
 
|-
! '''Return'''
+
! Return
 
| The return is the heap block that has been marked as device or nil if the request failed (The memory management unit should mark this region of memory as sharable)
 
| The return is the heap block that has been marked as device or nil if the request failed (The memory management unit should mark this region of memory as sharable)
 
|-
 
|-
! '''Note'''
+
! Note
| To allocate device memory use GetDeviceMem / AllocDeviceMem etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
+
| To allocate device memory use GetDeviceMem/AllocDeviceMem etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
 
|-
 
|-
 
|}
 
|}
Line 172: Line 827:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Hint'''
+
! Hint
 
| The hint provides the requested base address of the non cached heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil if any heap block is suitable
 
| The hint provides the requested base address of the non cached heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil if any heap block is suitable
 
|-
 
|-
! '''Size'''
+
! Size
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT.
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT.
 
|-
 
|-
! '''Return'''
+
! Return
 
| The return is the heap block that has been marked as non cached or nil if the request failed (The memory management unit should mark this region of memory as sharable)
 
| The return is the heap block that has been marked as non cached or nil if the request failed (The memory management unit should mark this region of memory as sharable)
 
|-
 
|-
! '''Note'''
+
! Note
| To allocate non cached memory use GetNoCacheMem / AllocNoCacheMem etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
+
| To allocate non cached memory use GetNoCacheMem/AllocNoCacheMem etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
 
|-
 
|-
 
|}
 
|}
Line 193: Line 848:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Hint'''
+
! Hint
 
| The hint provides the requested base address of the non shared heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil if any heap block is suitable
 
| The hint provides the requested base address of the non shared heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil if any heap block is suitable
 
|-
 
|-
! '''Size'''
+
! Size
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT.
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT.
 
|-
 
|-
! '''Return'''
+
! Return
 
| The return is the heap block that has been marked as non shared or nil if the request failed (The memory management unit should mark this region of memory as sharable)
 
| The return is the heap block that has been marked as non shared or nil if the request failed (The memory management unit should mark this region of memory as sharable)
 
|-
 
|-
! '''Note'''
+
! Note
| To allocate non shared memory use GetNonSharedMem / AllocNonSharedMem etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
+
| To allocate non shared memory use GetNonSharedMem/AllocNonSharedMem etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
 
|-
 
|-
 
|}
 
|}
Line 214: Line 869:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Hint'''
+
! Hint
 
| The hint provides a requested base address of the IRQ heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil if any heap block is suitable
 
| The hint provides a requested base address of the IRQ heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil if any heap block is suitable
 
|-
 
|-
! '''Size'''
+
! Size
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT.
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT.
 
|-
 
|-
! '''Affinity'''
+
! Affinity
 
| The affinity provides the processor affinity mask, a mask of 0 indicates no specific processor
 
| The affinity provides the processor affinity mask, a mask of 0 indicates no specific processor
 
|-
 
|-
! '''Return'''
+
! Return
 
| The return is the heap block that has been marked as IRQ or nil if the request failed
 
| The return is the heap block that has been marked as IRQ or nil if the request failed
 
|-
 
|-
! '''Note'''
+
! Note
| To allocate IRQ memory use GetIRQMem / AllocIRQMem etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
+
| To allocate IRQ memory use GetIRQMem/AllocIRQMem etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
 
|-
 
|-
 
|}
 
|}
Line 238: Line 893:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Hint'''
+
! Hint
 
| The hint provides a requested base address of the FIQ heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil if any heap block is suitable
 
| The hint provides a requested base address of the FIQ heap block but may be overridden by the memory manager if the block is already partially or fully allocated, pass nil if any heap block is suitable
 
|-
 
|-
! '''Size'''
+
! Size
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT.
 
| The size provides the requested size of the heap block. Size must be a power of 2 and both Hint and the returned pointer must be aligned on a multiple of HEAP_REQUEST_ALIGNMENT.
 
|-
 
|-
! '''Affinity'''
+
! Affinity
 
| The affinity provides the processor affinity mask, a mask of 0 indicates no specific processor
 
| The affinity provides the processor affinity mask, a mask of 0 indicates no specific processor
 
|-
 
|-
! '''Return'''
+
! Return
 
| The return is the heap block that has been marked as FIQ or nil if the request failed
 
| The return is the heap block that has been marked as FIQ or nil if the request failed
 
|-
 
|-
! '''Note'''
+
! Note
| To allocate FIQ memory use GetFIQMem / AllocFIQMem etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
+
| To allocate FIQ memory use GetFIQMem/AllocFIQMem etc. The return value points directly to the heap block, to access the memory referenced by the heap block you must add SizeOf(THeapBlock) to this value.
 
|-
 
|-
 
|}
 
|}
Line 265: Line 920:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 272: Line 927:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function GetAlignedMem(Size,Alignment:PtrUInt):Pointer;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function GetAlignedMem(Size,Alignment:PtrUInt):Pointer; inline;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate a block of normal memory aligned on a multiple of the alignment value</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate a block of normal memory aligned on a multiple of the alignment value</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 289: Line 944:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 301: Line 956:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 313: Line 968:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 325: Line 980:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 337: Line 992:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 349: Line 1,004:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 361: Line 1,016:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 373: Line 1,028:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 385: Line 1,040:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 397: Line 1,052:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 409: Line 1,064:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 421: Line 1,076:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 433: Line 1,088:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 445: Line 1,100:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| The memory must be freed using FreeIRQMem
 
|-
 
|-
 
|}
 
|}
Line 457: Line 1,112:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 +
|-
 +
! Note
 +
| The memory must be freed using FreeIRQMem
 
|-
 
|-
 
|}
 
|}
Line 469: Line 1,127:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| The memory must be freed using FreeFIQMem
 
|-
 
|-
 
|}
 
|}
Line 481: Line 1,139:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 +
|-
 +
! Note
 +
| The memory must be freed using FreeFIQMem
 
|-
 
|-
 
|}
 
|}
Line 493: Line 1,154:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 505: Line 1,166:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 517: Line 1,178:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 529: Line 1,190:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 536: Line 1,197:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function AllocAlignedMem(Size,Alignment:PtrUInt):Pointer;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function AllocAlignedMem(Size,Alignment:PtrUInt):Pointer; inline;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate and clear a block of normal memory aligned on a multiple of the alignment value</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate and clear a block of normal memory aligned on a multiple of the alignment value</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 553: Line 1,214:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 560: Line 1,221:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function ReAllocAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt):Pointer;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function ReAllocAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt):Pointer; inline;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Reallocate a block of normal memory aligned on a multiple of the alignment value</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Reallocate a block of normal memory aligned on a multiple of the alignment value</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 577: Line 1,238:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 589: Line 1,250:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 601: Line 1,262:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 613: Line 1,274:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 625: Line 1,286:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 637: Line 1,298:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 649: Line 1,310:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 661: Line 1,322:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 673: Line 1,334:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 685: Line 1,346:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 697: Line 1,358:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Alignment
 
| The alignment must be a multiple of the minimum alignment configuration
 
| The alignment must be a multiple of the minimum alignment configuration
 
|-
 
|-
Line 709: Line 1,370:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 721: Line 1,382:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 733: Line 1,394:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 745: Line 1,406:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 757: Line 1,418:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 769: Line 1,430:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 781: Line 1,442:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 793: Line 1,454:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 805: Line 1,466:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 817: Line 1,478:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 829: Line 1,490:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 841: Line 1,502:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 853: Line 1,514:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 865: Line 1,526:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
 
|}
 
|}
Line 877: Line 1,538:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| The memory must be freed using FreeIRQMem
 
| The memory must be freed using FreeIRQMem
 
|-
 
|-
Line 889: Line 1,550:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
! '''Note'''
+
! Note
 
| The memory must be freed using FreeIRQMem
 
| The memory must be freed using FreeIRQMem
 
|-
 
|-
Line 904: Line 1,565:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| The memory must be freed using FreeIRQMem
 
|-
 
|-
 
|}
 
|}
Line 916: Line 1,577:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 +
|-
 +
! Note
 +
| The memory must be freed using FreeIRQMem
 
|-
 
|-
 
|}
 
|}
Line 928: Line 1,592:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| The memory must be freed using FreeFIQMem
 
| The memory must be freed using FreeFIQMem
 
|-
 
|-
Line 940: Line 1,604:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
! '''Note'''
+
! Note
 
| The memory must be freed using FreeFIQMem
 
| The memory must be freed using FreeFIQMem
 
|-
 
|-
Line 955: Line 1,619:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| The memory must be freed using FreeFIQMem
 +
|-
 
|-
 
|-
 
|}
 
|}
Line 967: Line 1,632:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Alignment'''
+
! Note
| The alignment must be a multiple of the minimum alignment configuration
+
| Alignment must be a power of 2
 
|-
 
|-
|}
+
! Note
</div></div>
+
| The memory must be freed using FreeFIQMem
<br />
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
+
<pre style="border: 0; padding-bottom:0px;">function SizeIRQMem(Addr:Pointer):PtrUInt;</pre>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Return the size of an allocated block of IRQ memory</div>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
|-
+
! '''Note'''
+
| To be documented
+
 
|-
 
|-
 
|}
 
|}
Line 991: Line 1,647:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,003: Line 1,659:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,015: Line 1,671:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,027: Line 1,683:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,039: Line 1,695:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,051: Line 1,707:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,063: Line 1,719:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| This uses the block list (not the Free/Used/Small lists) in order to account for all blocks
 
| This uses the block list (not the Free/Used/Small lists) in order to account for all blocks
 
|-
 
|-
Line 1,075: Line 1,731:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,087: Line 1,743:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| This uses the block list (not the Free/Used/Small lists) in order to account for all blocks
 
| This uses the block list (not the Free/Used/Small lists) in order to account for all blocks
 
|-
 
|-
Line 1,099: Line 1,755:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,111: Line 1,767:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| This uses the block list (not the Free/Used/Small lists) in order to account for all blocks
 
| This uses the block list (not the Free/Used/Small lists) in order to account for all blocks
 
|-
 
|-
Line 1,123: Line 1,779:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,135: Line 1,791:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,147: Line 1,803:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,162: Line 1,818:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Address has already been normalized to include the Heap Block. Caller must hold the heap lock.
+
| Address has already been normalized to include the Heap Block
 +
Caller must hold the heap lock
 
|-
 
|-
 
|}
 
|}
Line 1,174: Line 1,831:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Address has already been normalized to include the Heap Block. Caller must hold the heap lock.
+
| Address has already been normalized to include the Heap Block
 +
Caller must hold the heap lock
 
|-
 
|-
 
|}
 
|}
Line 1,186: Line 1,844:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the heap lock
 
| Caller must hold the heap lock
 
|-
 
|-
Line 1,198: Line 1,856:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Return'''
+
! Return
 
| Return The return is the split portion of the block
 
| Return The return is the split portion of the block
 
|-
 
|-
! '''Note'''
+
! Note
| Caller must remove block from the free list. Caller must add split block to the free list. Caller must hold the heap lock.
+
| Caller must remove block from the free list. Caller must add split block to the free list.  
 +
Caller must hold the heap lock
 
|-
 
|-
 
|}
 
|}
Line 1,213: Line 1,872:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Return'''
+
! Return
 
| The return is the merged result of the blocks
 
| The return is the merged result of the blocks
 
|-
 
|-
! '''Note'''
+
! Note
| Caller must remove block from the free list. Caller must add merged block to the free list. Caller must hold the heap lock.
+
| Caller must remove block from the free list. Caller must add merged block to the free list.
 +
Caller must hold the heap lock
 
|-
 
|-
 
|}
 
|}
Line 1,223: Line 1,883:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function GetFreeBlock(Size:PtrUInt):PHeapBlock;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function function GetFreeBlock(Size:PtrUInt):PHeapBlock; inline;(Size:PtrUInt):PHeapBlock; inline;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get a free block of at least the size indicated</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get a free block of at least the size indicated</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Size'''
+
! Size
 
| The size has already been normalized to alignment and includes the size of the Heap Block
 
| The size has already been normalized to alignment and includes the size of the Heap Block
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the heap lock
 
| Caller must hold the heap lock
 
|-
 
|-
Line 1,243: Line 1,903:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Size'''
+
! Size
 
| The size has already been normalized to alignment and includes the size of the Heap Block
 
| The size has already been normalized to alignment and includes the size of the Heap Block
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the heap lock
 
| Caller must hold the heap lock
 
|-
 
|-
Line 1,258: Line 1,918:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Size'''
+
! Size
 
| The size is the exact size and has not been normalized
 
| The size is the exact size and has not been normalized
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the heap lock
 
| Caller must hold the heap lock
 
|-
 
|-
Line 1,273: Line 1,933:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the heap lock
 
| Caller must hold the heap lock
 
|-
 
|-
Line 1,285: Line 1,945:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the heap lock
 
| Caller must hold the heap lock
 
|-
 
|-
Line 1,297: Line 1,957:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Address'''
+
! Address
 
| The address has already been normalized to include the Heap Block
 
| The address has already been normalized to include the Heap Block
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the heap lock
 
| Caller must hold the heap lock
 
|-
 
|-
Line 1,307: Line 1,967:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function CheckUsedBlock(Address:Pointer):Boolean;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function CheckUsedBlock(Address:Pointer):Boolean; inline;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check a used block by address</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check a used block by address</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Address'''
+
! Address
 
| The address has already been normalized to include the Heap Block
 
| The address has already been normalized to include the Heap Block
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the heap lock
 
| Caller must hold the heap lock
 
|-
 
|-
Line 1,327: Line 1,987:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the heap lock
 
| Caller must hold the heap lock
 
|-
 
|-
Line 1,339: Line 1,999:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the heap lock
 
| Caller must hold the heap lock
 
|-
 
|-
Line 1,351: Line 2,011:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Address'''
+
! Address
 
| The address has already been normalized to include the IRQ Heap Block
 
| The address has already been normalized to include the IRQ Heap Block
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the IRQ heap lock
 
| Caller must hold the IRQ heap lock
 
|-
 
|-
Line 1,366: Line 2,026:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Address'''
+
! Address
 
| The address has already been normalized to include the IRQ Heap Block
 
| The address has already been normalized to include the IRQ Heap Block
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the IRQ heap lock
 
| Caller must hold the IRQ heap lock
 
|-
 
|-
Line 1,381: Line 2,041:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the IRQ heap lock
 
| Caller must hold the IRQ heap lock
 
|-
 
|-
Line 1,393: Line 2,053:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Return'''
+
! Return
 
| The return is the split portion of the block
 
| The return is the split portion of the block
 
|-
 
|-
! '''Note'''
+
! Note
| Caller must remove block from the IRQ free list. Caller must add split block to the IRQ free list. Caller must hold the IRQ heap lock.
+
| Caller must remove block from the IRQ free list. Caller must add split block to the IRQ free list.
 +
Caller must hold the IRQ heap lock
 
|-
 
|-
 
|}
 
|}
Line 1,408: Line 2,069:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Return'''
+
! Return
 
| The return is the merged result of the blocks
 
| The return is the merged result of the blocks
 
|-
 
|-
! '''Note'''
+
! Note
| Caller must remove block from the IRQ free list. Caller must add merged block to the IRQ free list. Caller must hold the IRQ heap lock.
+
| Caller must remove block from the IRQ free list. Caller must add merged block to the IRQ free list.
 +
Caller must hold the IRQ heap lock
 
|-
 
|-
 
|}
 
|}
Line 1,423: Line 2,085:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Size'''
+
! Size
 
| The size has already been normalized to alignment and includes the size of the IRQ Heap Block
 
| The size has already been normalized to alignment and includes the size of the IRQ Heap Block
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the IRQ heap lock
 
| Caller must hold the IRQ heap lock
 
|-
 
|-
Line 1,438: Line 2,100:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the IRQ heap lock
 
| Caller must hold the IRQ heap lock
 
|-
 
|-
Line 1,450: Line 2,112:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the IRQ heap lock
 
| Caller must hold the IRQ heap lock
 
|-
 
|-
Line 1,462: Line 2,124:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Address'''
+
! Address
 
| The address has already been normalized to include the FIQ Heap Block
 
| The address has already been normalized to include the FIQ Heap Block
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the FIQ heap lock
 
| Caller must hold the FIQ heap lock
 
|-
 
|-
Line 1,477: Line 2,139:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Address'''
+
! Address
 
| The address has already been normalized to include the FIQ Heap Block
 
| The address has already been normalized to include the FIQ Heap Block
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the FIQ heap lock
 
| Caller must hold the FIQ heap lock
 
|-
 
|-
Line 1,492: Line 2,154:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the FIQ heap lock
 
| Caller must hold the FIQ heap lock
 
|-
 
|-
Line 1,504: Line 2,166:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Return'''
+
! Return
 
| The return is the split portion of the block
 
| The return is the split portion of the block
 
|-
 
|-
! '''Note'''
+
! Note
| Caller must remove block from the FIQ free list. Caller must add split block to the FIQ free list. Caller must hold the FIQ heap lock.
+
| Caller must remove block from the FIQ free list. Caller must add split block to the FIQ free list.
 +
Caller must hold the FIQ heap lock
 
|-
 
|-
 
|}
 
|}
Line 1,519: Line 2,182:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Return'''
+
! Return
 
| The return is the merged result of the blocks
 
| The return is the merged result of the blocks
 
|-
 
|-
! '''Note'''
+
! Note
| Caller must remove block from the FIQ free list. Caller must add merged block to the FIQ free list. Caller must hold the FIQ heap lock.
+
| Caller must remove block from the FIQ free list. Caller must add merged block to the FIQ free list.
 +
Caller must hold the FIQ heap lock
 
|-
 
|-
 
|}
 
|}
Line 1,534: Line 2,198:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Size'''
+
! Size
 
| The size has already been normalized to alignment and includes the size of the FIQ Heap Block
 
| The size has already been normalized to alignment and includes the size of the FIQ Heap Block
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the FIQ heap lock
 
| Caller must hold the FIQ heap lock
 
|-
 
|-
Line 1,549: Line 2,213:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the FIQ heap lock
 
| Caller must hold the FIQ heap lock
 
|-
 
|-
Line 1,561: Line 2,225:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must hold the FIQ heap lock
 
| Caller must hold the FIQ heap lock
 
|-
 
|-
Line 1,571: Line 2,235:
  
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function SysGetMem(Size:PtrUInt):Pointer;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function SysGetMem(Size:PtrUInt):Pointer; inline;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate a block of normal memory</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate a block of normal memory</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,588: Line 2,252:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,600: Line 2,264:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| Size is not currently used
 
| Size is not currently used
 
|-
 
|-
Line 1,612: Line 2,276:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| Not inlined to AllocMemEx to save extra call from memory manager
 
|-
 
|-
 
|}
 
|}
Line 1,619: Line 2,283:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function SysReAllocMem(var Addr:Pointer; Size:PtrUInt):Pointer;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function SysReAllocMem(var Addr:Pointer; Size:PtrUInt):Pointer; inline;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Reallocate a block of normal memory</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Reallocate a block of normal memory</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,636: Line 2,300:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,648: Line 2,312:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,660: Line 2,324:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,672: Line 2,336:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,684: Line 2,348:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,696: Line 2,360:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,703: Line 2,367:
 
<br />
 
<br />
  
 +
'''Helper functions'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure AcquireHeapLock; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure ReleaseHeapLock; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure AcquireHeapIRQLock; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure ReleaseHeapIRQLock; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure AcquireHeapFIQLock; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure ReleaseHeapFIQLock; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure RegisterHeapLock(const Lock:THeapLock);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function HeapStateToString(State:LongWord):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
Return to [[Unit_Reference|Unit Reference]]
 
Return to [[Unit_Reference|Unit Reference]]

Latest revision as of 03:41, 10 January 2023

Return to Unit Reference


Description


Ultibo Heap Manager Interface unit

Constants



[Expand]
Heap specific constants HEAP_MIN_*


[Expand]
Heap signature HEAP_SIGNATURE_*


[Expand]
Heap block state HEAP_STATE_*


[Expand]
Heap block flag HEAP_FLAG_*


[Expand]
Heap small block HEAP_SMALL_*


Type definitions



Heap callback

THeapCallback = function(Size:PtrUInt):LongWord;

Heap block

[Expand]

PHeapBlock = ^THeapBlock;

THeapBlock = record

Heap small blocks

[Expand]

PSmallBlocks = ^TSmallBlocks;

TSmallBlocks = array[HEAP_SMALL_LOW..HEAP_SMALL_HIGH] of PHeapBlock;

Heap lock

[Expand]

PHeapLock = ^THeapLock;

THeapLock = record

Heap statistics

[Expand]

PHeapStatistics = ^THeapStatistics;

THeapStatistics = record

Heap snapshot

[Expand]

PHeapSnapshot = ^THeapSnapshot;

THeapSnapshot = record


Public variables


None defined

Function declarations



Initialization functions

[Expand]
procedure RegisterMemoryManager;
Description: To be documented


[Expand]
procedure RegisterHeapBlock(Address:Pointer; Size:PtrUInt);
Description: To be documented


[Expand]
function ReserveHeapBlock(Address:Pointer; Size:PtrUInt):Pointer;
Description: Request the Heap Block specified by address and size be reserved from allocation


[Expand]
function RequestHeapBlock(Hint:Pointer; Size:PtrUInt; Flags,Affinity:LongWord):Pointer;
Description: Request registration a Heap Block with specified flags and affinity within an existing block


[Expand]
function RequestSharedHeapBlock(Hint:Pointer; Size:PtrUInt):Pointer;
Description: Request registration of a Shared Heap Block within an existing block


[Expand]
function RequestLocalHeapBlock(Hint:Pointer; Size:PtrUInt; Affinity:LongWord):Pointer;
Description: Request registration of a Local Heap Block within an existing block


[Expand]
function RequestCodeHeapBlock(Hint:Pointer; Size:PtrUInt; Affinity:LongWord):Pointer;
Description: Request registration of a Code Heap Block within an existing block


[Expand]
function RequestDeviceHeapBlock(Hint:Pointer; Size:PtrUInt):Pointer;
Description: Request registration of a Device Heap Block within an existing block


[Expand]
function RequestNoCacheHeapBlock(Hint:Pointer; Size:PtrUInt):Pointer;
Description: Request registration of a Non Cached Heap Block within an existing block


[Expand]
function RequestNonSharedHeapBlock(Hint:Pointer; Size:PtrUInt):Pointer;
Description: Request registration of a Non Shared Heap Block within an existing block


[Expand]
function RequestIRQHeapBlock(Hint:Pointer; Size:PtrUInt; Affinity:LongWord):Pointer;
Description: Request registration of an IRQ Heap Block within an existing block


[Expand]
function RequestFIQHeapBlock(Hint:Pointer; Size:PtrUInt; Affinity:LongWord):Pointer;
Description: Request registration of an FIQ Heap Block within an existing block


Heap functions

[Expand]
function GetMemEx(Size:PtrUInt; Flags,Affinity:LongWord):Pointer;
Description: Allocate a block of memory with the flags and affinity requested


[Expand]
function GetAlignedMem(Size,Alignment:PtrUInt):Pointer; inline;
Description: Allocate a block of normal memory aligned on a multiple of the alignment value


[Expand]
function GetAlignedMemEx(Size,Alignment:PtrUInt; Flags,Affinity:LongWord):Pointer;
Description: Allocate a block of memory aligned on a multiple of the alignment value with the flags and affinity requested


[Expand]
function GetSharedMem(Size:PtrUInt):Pointer;
Description: Allocate a block of shared memory


[Expand]
function GetSharedAlignedMem(Size,Alignment:PtrUInt):Pointer;
Description: Allocate a block of shared memory aligned on a multiple of the alignment value


[Expand]
function GetLocalMem(Size:PtrUInt; Affinity:LongWord):Pointer;
Description: Allocate a block of local memory


[Expand]
function GetLocalAlignedMem(Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Description: Allocate a block of local memory aligned on a multiple of the alignment value


[Expand]
function GetCodeMem(Size:PtrUInt; Affinity:LongWord):Pointer;
Description: Allocate a block of code memory


[Expand]
function GetCodeAlignedMem(Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Description: Allocate a block of code memory aligned on a multiple of the alignment value


[Expand]
function GetDeviceMem(Size:PtrUInt):Pointer;
Description: Allocate a block of device memory


[Expand]
function GetDeviceAlignedMem(Size,Alignment:PtrUInt):Pointer;
Description: Allocate a block of device memory aligned on a multiple of the alignment value


[Expand]
function GetNoCacheMem(Size:PtrUInt):Pointer;
Description: Allocate a block of non cached memory


[Expand]
function GetNoCacheAlignedMem(Size,Alignment:PtrUInt):Pointer;
Description: Allocate a block of non cached memory aligned on a multiple of the alignment value


[Expand]
function GetNonSharedMem(Size:PtrUInt):Pointer;
Description: Allocate a block of non shared memory


[Expand]
function GetNonSharedAlignedMem(Size,Alignment:PtrUInt):Pointer;
Description: Allocate a block of non shared memory aligned on a multiple of the alignment value


[Expand]
function GetIRQMem(Size:PtrUInt; Affinity:LongWord):Pointer;
Description: Allocate a block of IRQ memory


[Expand]
function GetIRQAlignedMem(Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Description: Allocate a block of IRQ memory aligned on a multiple of the alignment value


[Expand]
function GetFIQMem(Size:PtrUInt; Affinity:LongWord):Pointer;
Description: Allocate a block of FIQ memory


[Expand]
function GetFIQAlignedMem(Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Description: Allocate a block of FIQ memory aligned on a multiple of the alignment value


[Expand]
function FreeIRQMem(Addr:Pointer):PtrUInt;
Description: Free a block of IRQ memory


[Expand]
function FreeFIQMem(Addr:Pointer):PtrUInt;
Description: Free a block of FIQ memory


[Expand]
function AllocMemEx(Size:PtrUInt; Flags,Affinity:LongWord):Pointer;
Description: Allocate and clear a block of memory with the flags and affinity requested


[Expand]
function ReAllocMemEx(var Addr:Pointer; Size:PtrUInt; Flags,Affinity:LongWord):Pointer;
Description: Reallocate a block of memory with the flags and affinity requested


[Expand]
function AllocAlignedMem(Size,Alignment:PtrUInt):Pointer; inline;
Description: Allocate and clear a block of normal memory aligned on a multiple of the alignment value


[Expand]
function AllocAlignedMemEx(Size,Alignment:PtrUInt; Flags,Affinity:LongWord):Pointer;
Description: Allocate and clear a block of normal memory aligned on a multiple of the alignment value with the flags and affinity requested


[Expand]
function ReAllocAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt):Pointer; inline;
Description: Reallocate a block of normal memory aligned on a multiple of the alignment value


[Expand]
function ReAllocAlignedMemEx(var Addr:Pointer; Size,Alignment:PtrUInt; Flags,Affinity:LongWord):Pointer;
Description: Reallocate a block of memory aligned on a multiple of the alignment value with the flags and affinity requested


[Expand]
function AllocSharedMem(Size:PtrUInt):Pointer;
Description: Allocate and clear a block of shared memory


[Expand]
function AllocSharedAlignedMem(Size,Alignment:PtrUInt):Pointer;
Description: Allocate and clear a block of shared memory aligned on a multiple of the alignment value


[Expand]
function ReAllocSharedMem(var Addr:Pointer; Size:PtrUInt):Pointer;
Description: Reallocate a block of shared memory


[Expand]
function ReAllocSharedAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt):Pointer;
Description: Reallocate a block of shared memory aligned on a multiple of the alignment value


[Expand]
function AllocLocalMem(Size:PtrUInt; Affinity:LongWord):Pointer;
Description: Allocate and clear a block of local memory


[Expand]
function AllocLocalAlignedMem(Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Description: Allocate and clear a block of local memory aligned on a multiple of the alignment value


[Expand]
function ReAllocLocalMem(var Addr:Pointer; Size:PtrUInt; Affinity:LongWord):Pointer;
Description: Reallocate a block of local memory


[Expand]
function ReAllocLocalAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Description: Reallocate a block of local memory aligned on a multiple of the alignment value


[Expand]
function AllocCodeMem(Size:PtrUInt; Affinity:LongWord):Pointer;
Description: Allocate and clear a block of code memory


[Expand]
function AllocCodeAlignedMem(Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Description: Allocate and clear a block of code memory aligned on a multiple of the alignment value


[Expand]
function ReAllocCodeMem(var Addr:Pointer; Size:PtrUInt; Affinity:LongWord):Pointer;
Description: Reallocate a block of code memory


[Expand]
function ReAllocCodeAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Description: Reallocate a block of code memory aligned on a multiple of the alignment value


[Expand]
function AllocDeviceMem(Size:PtrUInt):Pointer;
Description: Allocate and clear a block of device memory


[Expand]
function AllocDeviceAlignedMem(Size,Alignment:PtrUInt):Pointer;
Description: Allocate and clear a block of device memory aligned on a multiple of the alignment value


[Expand]
function ReAllocDeviceMem(var Addr:Pointer; Size:PtrUInt):Pointer;
Description: Reallocate a block of device memory


[Expand]
function ReAllocDeviceAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt):Pointer;
Description: Reallocate a block of device memory aligned on a multiple of the alignment value


[Expand]
function AllocNoCacheMem(Size:PtrUInt):Pointer;
Description: Allocate and clear a block of non cached memory


[Expand]
function AllocNoCacheAlignedMem(Size,Alignment:PtrUInt):Pointer;
Description: Allocate and clear a block of non cached memory aligned on a multiple of the alignment value


[Expand]
function ReAllocNoCacheMem(var Addr:Pointer; Size:PtrUInt):Pointer;
Description: Reallocate a block of non cached memory


[Expand]
function ReAllocNoCacheAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt):Pointer;
Description: Reallocate a block of non cached memory aligned on a multiple of the alignment value


[Expand]
function AllocNonSharedMem(Size:PtrUInt):Pointer;
Description: Allocate and clear a block of non shared memory


[Expand]
function AllocNonSharedAlignedMem(Size,Alignment:PtrUInt):Pointer;
Description: Allocate and clear a block of non shared memory aligned on a multiple of the alignment value


[Expand]
function ReAllocNonSharedMem(var Addr:Pointer; Size:PtrUInt):Pointer;
Description: Reallocate a block of non shared memory


[Expand]
function ReAllocNonSharedAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt):Pointer;
Description: Reallocate a block of non shared memory aligned on a multiple of the alignment value


[Expand]
function AllocIRQMem(Size:PtrUInt; Affinity:LongWord):Pointer;
Description: Allocate and clear a block of IRQ memory


[Expand]
function AllocIRQAlignedMem(Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Description: Allocate and clear a block of IRQ memory aligned on a multiple of the alignment value


[Expand]
function ReAllocIRQMem(var Addr:Pointer; Size:PtrUInt; Affinity:LongWord):Pointer;
Description: Reallocate a block of IRQ memory


[Expand]
function ReAllocIRQAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Description: Reallocate a block of IRQ memory aligned on a multiple of the alignment value


[Expand]
function AllocFIQMem(Size:PtrUInt; Affinity:LongWord):Pointer;
Description: Allocate and clear a block of FIQ memory


[Expand]
function AllocFIQAlignedMem(Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Description: Allocate and clear a block of FIQ memory aligned on a multiple of the alignment value


[Expand]
function ReAllocFIQMem(var Addr:Pointer; Size:PtrUInt; Affinity:LongWord):Pointer;
Description: Reallocate a block of FIQ memory


[Expand]
function ReAllocFIQAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Description: Reallocate a block of FIQ memory aligned on a multiple of the alignment value


[Expand]
function SizeFIQMem(Addr:Pointer):PtrUInt;
Description: Return the size of an allocated block of FIQ memory


[Expand]
function MemFlags(Addr:Pointer):LongWord;
Description: Return the flags of an allocated block of memory


[Expand]
function MemFlagsIRQ(Addr:Pointer):LongWord;
Description: Return the flags of an allocated block of IRQ memory


[Expand]
function MemFlagsFIQ(Addr:Pointer):LongWord;
Description: Return the flags of an allocated block of FIQ memory


[Expand]
function GetHeapStatistics:THeapStatistics;
Description: Return detailed statistics for the heap manager


[Expand]
function GetHeapBlockCount(State:LongWord):LongWord;
Description: Get the total number of current heap blocks based on state


[Expand]
function GetHeapBlockCountEx(State,Flags,Affinity:LongWord):LongWord;
Description: Get the number of current heap blocks based on state, flags and affinity


[Expand]
function GetHeapBlockMin(State:LongWord):LongWord;
Description: Get the minimum size of current heap blocks based on state


[Expand]
function GetHeapBlockMinEx(State,Flags,Affinity:LongWord):LongWord;
Description: Get the minimum size of current heap blocks based on state, flags and affinity


[Expand]
function GetHeapBlockMax(State:LongWord):LongWord;
Description: Get the maximum size of current heap blocks based on state


[Expand]
function GetHeapBlockMaxEx(State,Flags,Affinity:LongWord):LongWord;
Description: Get the maximum size of current heap blocks based on state, flags and affinity


[Expand]
function CreateHeapSnapshot(State:LongWord):PHeapSnapshot;
Description: To be documented


[Expand]
function CreateHeapSnapshotEx(State,Flags,Affinity:LongWord):PHeapSnapshot;
Description: To be documented


[Expand]
function DestroyHeapSnapshot(Snapshot:PHeapSnapshot):LongWord;
Description: To be documented


Internal functions

[Expand]
function GetHeapBlock(Address:Pointer):PHeapBlock;
Description: Get the Heap Block referenced by Address


[Expand]
function FindHeapBlock(Address:Pointer; Size:PtrUInt):PHeapBlock;
Description: Find the Heap Block containing Address up to the Size specified


[Expand]
function AddHeapBlock(Block:PHeapBlock):Boolean;
Description: Add a heap block, sorted by ascending Address order


[Expand]
function SplitHeapBlock(Block:PHeapBlock; Size:PtrUInt):PHeapBlock;
Description: Split a heap block at the size indicated


[Expand]
function MergeHeapBlock(Block:PHeapBlock):PHeapBlock;
Description: Merge a heap block with Prev or Next blocks if free


[Expand]
function function GetFreeBlock(Size:PtrUInt):PHeapBlock; inline;(Size:PtrUInt):PHeapBlock; inline;
Description: Get a free block of at least the size indicated


[Expand]
function GetFreeBlockEx(Size:PtrUInt; Flags,Affinity:LongWord):PHeapBlock;
Description: Get a free block of at least the size indicated with the flags and affinity requested


[Expand]
function FindFreeBlock(Size:PtrUInt):PHeapBlock;
Description: Find a free block of at least the size indicated with no flags or affinity which is alignable to the HEAP_REQUEST_ALIGNMENT value


[Expand]
function AddFreeBlock(Block:PHeapBlock):Boolean;
Description: Add a free block, sorted by ascending Size order


[Expand]
function RemoveFreeBlock(Block:PHeapBlock):Boolean;
Description: Remove a free block


[Expand]
function GetUsedBlock(Address:Pointer):PHeapBlock;
Description: Get a used block by address


[Expand]
function CheckUsedBlock(Address:Pointer):Boolean; inline;
Description: Check a used block by address


[Expand]
function AddUsedBlock(Block:PHeapBlock):Boolean;
Description: Add a used block


[Expand]
function RemoveUsedBlock(Block:PHeapBlock):Boolean;
Description: Remove a used block


[Expand]
function GetIRQBlock(Address:Pointer):PHeapBlock;
Description: Get the IRQ Heap Block referenced by Address


[Expand]
function CheckIRQBlock(Address:Pointer):Boolean;
Description: Check the IRQ Heap Block referenced by Address


[Expand]
function AddIRQBlock(Block:PHeapBlock):Boolean;
Description: Add an IRQ heap block, sorted by ascending Address order


[Expand]
function SplitIRQBlock(Block:PHeapBlock; Size:PtrUInt):PHeapBlock;
Description: Split an IRQ heap block at the size indicated


[Expand]
function MergeIRQBlock(Block:PHeapBlock):PHeapBlock;
Description: Merge an IRQ heap block with Prev or Next blocks if free


[Expand]
function GetFreeIRQBlock(Size:PtrUInt; Affinity:LongWord):PHeapBlock;
Description: Get a free IRQ block of at least the size indicated


[Expand]
function AddFreeIRQBlock(Block:PHeapBlock):Boolean;
Description: Add a free IRQ block, sorted by ascending Size order


[Expand]
function RemoveFreeIRQBlock(Block:PHeapBlock):Boolean;
Description: Remove a free IRQ block


[Expand]
function GetFIQBlock(Address:Pointer):PHeapBlock;
Description: Get the FIQ Heap Block referenced by Address


[Expand]
function CheckFIQBlock(Address:Pointer):Boolean;
Description: Check the FIQ Heap Block referenced by Address


[Expand]
function AddFIQBlock(Block:PHeapBlock):Boolean;
Description: Add an FIQ heap block, sorted by ascending Address order


[Expand]
function SplitFIQBlock(Block:PHeapBlock; Size:PtrUInt):PHeapBlock;
Description: Split an FIQ heap block at the size indicated


[Expand]
function MergeFIQBlock(Block:PHeapBlock):PHeapBlock;
Description: Merge an FIQ heap block with Prev or Next blocks if free


[Expand]
function GetFreeFIQBlock(Size:PtrUInt; Affinity:LongWord):PHeapBlock;
Description: Get a free FIQ block of at least the size indicated


[Expand]
function AddFreeFIQBlock(Block:PHeapBlock):Boolean;
Description: Add a free FIQ block, sorted by ascending Size order


[Expand]
function RemoveFreeFIQBlock(Block:PHeapBlock):Boolean;
Description: Remove a free FIQ block


RTL heap manager functions

[Expand]
function SysGetMem(Size:PtrUInt):Pointer; inline;
Description: Allocate a block of normal memory


[Expand]
function SysFreeMem(Addr:Pointer):PtrUInt;
Description: Free a block of memory


[Expand]
function SysFreeMemSize(Addr:Pointer; Size:PtrUInt):PtrUInt;
Description: Free a block of memory


[Expand]
function SysAllocMem(Size:PtrUInt):Pointer;
Description: Allocate and clear a block of normal memory


[Expand]
function SysReAllocMem(var Addr:Pointer; Size:PtrUInt):Pointer; inline;
Description: Reallocate a block of normal memory


[Expand]
function SysSizeMem(Addr:Pointer):PtrUInt;
Description: Return the size of an allocated block of memory


[Expand]
procedure SysInitThread;
Description: Initialize thread specific heap information


[Expand]
procedure SysDoneThread;
Description: Finalize thread specific heap information


[Expand]
procedure SysRelocateHeap;
Description: Relocate heap data


[Expand]
function SysGetHeapStatus:THeapStatus;
Description: Return status information for the heap manager


[Expand]
function SysGetFPCHeapStatus:TFPCHeapStatus;
Description: Return status information for the heap manager


Helper functions

[Expand]
procedure AcquireHeapLock; inline;
Description: To be documented


[Expand]
procedure ReleaseHeapLock; inline;
Description: To be documented


[Expand]
procedure AcquireHeapIRQLock; inline;
Description: To be documented


[Expand]
procedure ReleaseHeapIRQLock; inline;
Description: To be documented


[Expand]
procedure AcquireHeapFIQLock; inline;
Description: To be documented


[Expand]
procedure ReleaseHeapFIQLock; inline;
Description: To be documented


[Expand]
procedure RegisterHeapLock(const Lock:THeapLock);
Description: To be documented


[Expand]
function HeapStateToString(State:LongWord):String;
Description: To be documented


Return to Unit Reference