Difference between revisions of "Unit HeapManager"
(15 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
---- | ---- | ||
− | '''Ultibo Heap Manager | + | '''Ultibo Heap Manager Interface unit''' |
− | + | ||
− | + | ||
=== Constants === | === Constants === | ||
Line 17: | Line 15: | ||
<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;" | ||
+ | |- | ||
+ | | <code>HEAP_MIN_BLOCK = 57;</code> | ||
+ | | SizeOf(THeapBlock) + 1 | ||
|- | |- | ||
| <code>HEAP_MIN_BLOCK = 33;</code> | | <code>HEAP_MIN_BLOCK = 33;</code> | ||
Line 28: | Line 29: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <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 | + | <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;"> | <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;" | ||
Line 42: | Line 43: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <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 | + | <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;"> | <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;" | ||
Line 64: | Line 65: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <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 | + | <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;"> | <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;" | ||
Line 100: | Line 101: | ||
| <code>HEAP_FLAG_RECLAIM = $00000200;</code> | | <code>HEAP_FLAG_RECLAIM = $00000200;</code> | ||
| A reclaimable memory block (eg Disk Cache)(with a registered callback to reclaim as required for normal memory) | | A reclaimable memory block (eg Disk Cache)(with a registered callback to reclaim as required for normal memory) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>HEAP_FLAG_CUSTOM = $08000000;</code> | ||
+ | | A custom flag reserved for non standard uses | ||
|- | |- | ||
|colspan="2"| | |colspan="2"| | ||
Line 113: | Line 119: | ||
<br /> | <br /> | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | <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 | + | <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;"> | <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;" | ||
+ | |- | ||
+ | | <code>HEAP_SMALL_MIN = 56;</code> | ||
+ | | SizeOf(THeapBlock) Minimum size of a small heap block | ||
|- | |- | ||
| <code>HEAP_SMALL_MIN = 32;</code> | | <code>HEAP_SMALL_MIN = 32;</code> | ||
Line 132: | Line 141: | ||
|- | |- | ||
| <code>HEAP_SMALL_LOW = (HEAP_SMALL_MIN div HEAP_SMALL_ALIGN);</code> | | <code>HEAP_SMALL_LOW = (HEAP_SMALL_MIN div HEAP_SMALL_ALIGN);</code> | ||
− | | 8 | + | | 8 (32-bit) / 14 (64-bit) |
|- | |- | ||
| <code>HEAP_SMALL_HIGH = (HEAP_SMALL_MAX div HEAP_SMALL_ALIGN);</code> | | <code>HEAP_SMALL_HIGH = (HEAP_SMALL_MAX div HEAP_SMALL_ALIGN);</code> | ||
Line 144: | Line 153: | ||
---- | ---- | ||
− | '' | + | |
+ | '''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;" | ||
+ | |- | ||
+ | | | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </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%;"| | ||
+ | |- | ||
+ | | <code>IRQLock:THandle;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FIQLock:THandle;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>AcquireLock:function(Handle:THandle):LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReleaseLock:function(Handle:THandle):LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>AcquireIRQLock:function(Handle:THandle):LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReleaseIRQLock:function(Handle:THandle):LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>AcquireFIQLock:function(Handle:THandle):LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReleaseFIQLock:function(Handle:THandle):LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </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%;"| | ||
+ | |- | ||
+ | | <code>AllocCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReallocCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetAlignedCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>AllocAlignedCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReallocAlignedCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetSharedCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>AllocSharedCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReallocSharedCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetLocalCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>AllocLocalCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReallocLocalCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetCodeCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>AllocCodeCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReallocCodeCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetDeviceCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>AllocDeviceCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReallocDeviceCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetNoCacheCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>AllocNoCacheCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReallocNoCacheCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetNonSharedCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>AllocNonSharedCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReallocNonSharedCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetIRQCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>AllocIRQCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReallocIRQCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetFIQCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>AllocFIQCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReallocFIQCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Free'' | ||
+ | |- | ||
+ | | <code>FreeCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FreeIRQCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FreeFIQCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FreeSizeCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Size'' | ||
+ | |- | ||
+ | | <code>SizeCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SizeIRQCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SizeFIQCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Flags'' | ||
+ | |- | ||
+ | | <code>FlagsCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FlagsIRQCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FlagsFIQCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Register'' | ||
+ | |- | ||
+ | | <code>RegisterCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Reserve'' | ||
+ | |- | ||
+ | | <code>ReserveCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Request'' | ||
+ | |- | ||
+ | | <code>RequestCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>RequestSharedCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>RequestLocalCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>RequestCodeCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>RequestDeviceCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>RequestNoCacheCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>RequestNonSharedCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>RequestIRQCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>RequestFIQCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Get Internal'' | ||
+ | |- | ||
+ | | <code>GetZeroCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetRemainCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetInvalidCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetUnavailableCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetAddFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetSplitFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetRemoveFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Realloc Internal'' | ||
+ | |- | ||
+ | | <code>ReallocZeroCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReallocSmallerCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReallocLargerCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReallocReleaseCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReallocReleaseBytes:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReallocAddFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReallocSplitFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReallocRemoveFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''GetAligned Internal'' | ||
+ | |- | ||
+ | | <code>GetAlignedZeroCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetAlignedRemainCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetAlignedInvalidCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetAlignedUndersizeCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetAlignedUnavailableCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetAlignedAddFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetAlignedSplitFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetAlignedRemoveFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetAlignedReleaseCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetAlignedReleaseBytes:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Free Internal'' | ||
+ | |- | ||
+ | | <code>FreeInvalidCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FreeAddFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FreeMergeFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FreeRemoveFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Size Internal'' | ||
+ | |- | ||
+ | | <code>SizeInvalidCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Flags Internal'' | ||
+ | |- | ||
+ | | <code>FlagsInvalidCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Register Internal'' | ||
+ | |- | ||
+ | | <code>RegisterInvalidCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>RegisterAddFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Reserve Internal'' | ||
+ | |- | ||
+ | | <code>ReserveInvalidCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReserveAddFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReserveSplitFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReserveRemoveFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ReserveUnavailableCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Request Internal'' | ||
+ | |- | ||
+ | | <code>RequestInvalidCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>RequestAddFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>RequestSplitFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>RequestRemoveFailCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>RequestUnavailableCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Split Internal'' | ||
+ | |- | ||
+ | | <code>SplitCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Merge Internal'' | ||
+ | |- | ||
+ | | <code>MergePrevCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>MergeNextCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''Block Internal'' | ||
+ | |- | ||
+ | | <code>GetSmallCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>GetLargeCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FindFreeCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>AddSmallCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>AddLargeCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>RemoveSmallCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>RemoveLargeCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SmallUnavailableCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </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 === | ||
---- | ---- | ||
− | '' | + | ''None defined'' |
=== Function declarations === | === Function declarations === | ||
Line 163: | Line 670: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 175: | Line 682: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None 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 187: | Line 713: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 |
| 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 |
| 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 |
| 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 |
− | | 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 211: | Line 737: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 |
| 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 |
| 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 |
− | | 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 232: | Line 758: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 |
| 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 |
| 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 |
| 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 |
− | | 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 256: | Line 782: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 |
| 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 |
| 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 |
| 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 |
− | | 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 280: | Line 806: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 |
| 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 |
| 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 |
− | | 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 301: | Line 827: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 |
| 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 |
| 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 |
− | | 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 322: | Line 848: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 |
| 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 |
| 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 |
− | | 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 343: | Line 869: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 |
| 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 |
| 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 |
| 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 |
− | | 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 367: | Line 893: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 |
| 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 |
| 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 |
| 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 |
− | | 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 394: | Line 920: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 401: | 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;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 418: | Line 944: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 430: | Line 956: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 442: | Line 968: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 454: | Line 980: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 466: | Line 992: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 478: | Line 1,004: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 490: | Line 1,016: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 502: | Line 1,028: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 514: | Line 1,040: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 526: | Line 1,052: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 538: | Line 1,064: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 550: | Line 1,076: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 562: | Line 1,088: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 574: | Line 1,100: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | The memory must be freed using FreeIRQMem |
|- | |- | ||
|} | |} | ||
Line 586: | Line 1,112: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
+ | |- | ||
+ | ! Note | ||
+ | | The memory must be freed using FreeIRQMem | ||
|- | |- | ||
|} | |} | ||
Line 598: | Line 1,127: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | The memory must be freed using FreeFIQMem |
|- | |- | ||
|} | |} | ||
Line 610: | Line 1,139: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
+ | |- | ||
+ | ! Note | ||
+ | | The memory must be freed using FreeFIQMem | ||
|- | |- | ||
|} | |} | ||
Line 622: | Line 1,154: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 634: | Line 1,166: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 646: | Line 1,178: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 658: | Line 1,190: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 665: | 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;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 682: | Line 1,214: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 689: | 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;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 706: | Line 1,238: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 718: | Line 1,250: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 730: | Line 1,262: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 742: | Line 1,274: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 754: | Line 1,286: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 766: | Line 1,298: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 778: | Line 1,310: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 790: | Line 1,322: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 802: | Line 1,334: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 814: | Line 1,346: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 826: | Line 1,358: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Alignment |
| The alignment must be a multiple of the minimum alignment configuration | | The alignment must be a multiple of the minimum alignment configuration | ||
|- | |- | ||
Line 838: | Line 1,370: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 850: | Line 1,382: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 862: | Line 1,394: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 874: | Line 1,406: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 886: | Line 1,418: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 898: | Line 1,430: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 910: | Line 1,442: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 922: | Line 1,454: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 934: | Line 1,466: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 946: | Line 1,478: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 958: | Line 1,490: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 970: | Line 1,502: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 982: | Line 1,514: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 994: | Line 1,526: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
|} | |} | ||
Line 1,006: | Line 1,538: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| The memory must be freed using FreeIRQMem | | The memory must be freed using FreeIRQMem | ||
|- | |- | ||
Line 1,018: | Line 1,550: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
− | ! | + | ! Note |
| The memory must be freed using FreeIRQMem | | The memory must be freed using FreeIRQMem | ||
|- | |- | ||
Line 1,033: | Line 1,565: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | The memory must be freed using FreeIRQMem |
|- | |- | ||
|} | |} | ||
Line 1,045: | Line 1,577: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
+ | |- | ||
+ | ! Note | ||
+ | | The memory must be freed using FreeIRQMem | ||
|- | |- | ||
|} | |} | ||
Line 1,057: | Line 1,592: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| The memory must be freed using FreeFIQMem | | The memory must be freed using FreeFIQMem | ||
|- | |- | ||
Line 1,069: | Line 1,604: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
− | ! | + | ! Note |
| The memory must be freed using FreeFIQMem | | The memory must be freed using FreeFIQMem | ||
|- | |- | ||
Line 1,084: | Line 1,619: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | The memory must be freed using FreeFIQMem |
+ | |- | ||
|- | |- | ||
|} | |} | ||
Line 1,096: | Line 1,632: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Alignment must be a power of 2 |
|- | |- | ||
− | + | ! Note | |
− | + | | The memory must be freed using FreeFIQMem | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | ! | + | |
− | | | + | |
|- | |- | ||
|} | |} | ||
Line 1,120: | Line 1,647: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,132: | Line 1,659: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,144: | Line 1,671: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,156: | Line 1,683: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,168: | Line 1,695: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,180: | Line 1,707: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,192: | Line 1,719: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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,204: | Line 1,731: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,216: | Line 1,743: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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,228: | Line 1,755: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,240: | Line 1,767: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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,252: | Line 1,779: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,264: | Line 1,791: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,276: | Line 1,803: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,291: | Line 1,818: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Address has already been normalized to include the Heap Block | + | | Address has already been normalized to include the Heap Block |
+ | Caller must hold the heap lock | ||
|- | |- | ||
|} | |} | ||
Line 1,303: | Line 1,831: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Address has already been normalized to include the Heap Block | + | | Address has already been normalized to include the Heap Block |
+ | Caller must hold the heap lock | ||
|- | |- | ||
|} | |} | ||
Line 1,315: | Line 1,844: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the heap lock | | Caller must hold the heap lock | ||
|- | |- | ||
Line 1,327: | Line 1,856: | ||
{| 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 | | Return The return is the split portion of the block | ||
|- | |- | ||
− | ! | + | ! 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,342: | Line 1,872: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| The return is the merged result of the blocks | | The return is the merged result of the blocks | ||
|- | |- | ||
− | ! | + | ! 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,352: | 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 |
| 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 |
| Caller must hold the heap lock | | Caller must hold the heap lock | ||
|- | |- | ||
Line 1,372: | Line 1,903: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 |
| Caller must hold the heap lock | | Caller must hold the heap lock | ||
|- | |- | ||
Line 1,387: | Line 1,918: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Size |
| The size is the exact size and has not been normalized | | The size is the exact size and has not been normalized | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the heap lock | | Caller must hold the heap lock | ||
|- | |- | ||
Line 1,402: | Line 1,933: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the heap lock | | Caller must hold the heap lock | ||
|- | |- | ||
Line 1,414: | Line 1,945: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the heap lock | | Caller must hold the heap lock | ||
|- | |- | ||
Line 1,426: | Line 1,957: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Address |
| The address has already been normalized to include the Heap Block | | The address has already been normalized to include the Heap Block | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the heap lock | | Caller must hold the heap lock | ||
|- | |- | ||
Line 1,441: | Line 1,972: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Address |
| The address has already been normalized to include the Heap Block | | The address has already been normalized to include the Heap Block | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the heap lock | | Caller must hold the heap lock | ||
|- | |- | ||
Line 1,456: | Line 1,987: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the heap lock | | Caller must hold the heap lock | ||
|- | |- | ||
Line 1,468: | Line 1,999: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the heap lock | | Caller must hold the heap lock | ||
|- | |- | ||
Line 1,480: | Line 2,011: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 |
| Caller must hold the IRQ heap lock | | Caller must hold the IRQ heap lock | ||
|- | |- | ||
Line 1,495: | Line 2,026: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 |
| Caller must hold the IRQ heap lock | | Caller must hold the IRQ heap lock | ||
|- | |- | ||
Line 1,510: | Line 2,041: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the IRQ heap lock | | Caller must hold the IRQ heap lock | ||
|- | |- | ||
Line 1,522: | Line 2,053: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| The return is the split portion of the block | | The return is the split portion of the block | ||
|- | |- | ||
− | ! | + | ! 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,537: | Line 2,069: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| The return is the merged result of the blocks | | The return is the merged result of the blocks | ||
|- | |- | ||
− | ! | + | ! 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,552: | Line 2,085: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 |
| Caller must hold the IRQ heap lock | | Caller must hold the IRQ heap lock | ||
|- | |- | ||
Line 1,567: | Line 2,100: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the IRQ heap lock | | Caller must hold the IRQ heap lock | ||
|- | |- | ||
Line 1,579: | Line 2,112: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the IRQ heap lock | | Caller must hold the IRQ heap lock | ||
|- | |- | ||
Line 1,591: | Line 2,124: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 |
| Caller must hold the FIQ heap lock | | Caller must hold the FIQ heap lock | ||
|- | |- | ||
Line 1,606: | Line 2,139: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 |
| Caller must hold the FIQ heap lock | | Caller must hold the FIQ heap lock | ||
|- | |- | ||
Line 1,621: | Line 2,154: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the FIQ heap lock | | Caller must hold the FIQ heap lock | ||
|- | |- | ||
Line 1,633: | Line 2,166: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| The return is the split portion of the block | | The return is the split portion of the block | ||
|- | |- | ||
− | ! | + | ! 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,648: | Line 2,182: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Return |
| The return is the merged result of the blocks | | The return is the merged result of the blocks | ||
|- | |- | ||
− | ! | + | ! 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,663: | Line 2,198: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 |
| Caller must hold the FIQ heap lock | | Caller must hold the FIQ heap lock | ||
|- | |- | ||
Line 1,678: | Line 2,213: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the FIQ heap lock | | Caller must hold the FIQ heap lock | ||
|- | |- | ||
Line 1,690: | Line 2,225: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the FIQ heap lock | | Caller must hold the FIQ heap lock | ||
|- | |- | ||
Line 1,700: | 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 |
| None documented | | None documented | ||
|- | |- | ||
Line 1,717: | Line 2,252: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,729: | Line 2,264: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Size is not currently used | | Size is not currently used | ||
|- | |- | ||
Line 1,741: | Line 2,276: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Not inlined to AllocMemEx to save extra call from memory manager |
|- | |- | ||
|} | |} | ||
Line 1,748: | 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 |
| None documented | | None documented | ||
|- | |- | ||
Line 1,765: | Line 2,300: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,777: | Line 2,312: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,789: | Line 2,324: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,801: | Line 2,336: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,813: | Line 2,348: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,825: | Line 2,360: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,840: | Line 2,375: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,852: | Line 2,387: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,864: | Line 2,399: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,876: | Line 2,411: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,888: | Line 2,423: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,900: | Line 2,435: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,912: | Line 2,447: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,924: | Line 2,459: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- |
Latest revision as of 03:41, 10 January 2023
Return to Unit Reference
Description
Ultibo Heap Manager Interface unit
Constants
HEAP_MIN_*
HEAP_MIN_BLOCK = 57;
|
SizeOf(THeapBlock) + 1 |
HEAP_MIN_BLOCK = 33;
|
SizeOf(THeapBlock) + 1 |
HEAP_MIN_ALIGN = 64;
|
SizeOf(THeapBlock) * 2 Must be greater than or equal to HEAP_MIN_BLOCK, must be a power of 2 |
HEAP_SIGNATURE_*
HEAP_SIGNATURE = $E84DF600;
|
|
HEAP_SIGNATURE_MASK = $FFFFFF00;
|
HEAP_STATE_*
HEAP_STATE_FREE = 0;
|
|
HEAP_STATE_USED = 1;
|
|
HEAP_STATE_MASK = $000000FF;
|
|
HEAP_STATE_ALL = 2;
|
Only for use by GetHeapBlockCount/GetHeapBlockMin/GetHeapBlockMax |
HEAP_FLAG_*
HEAP_FLAG_NORMAL = $00000000;
|
A normal memory block |
HEAP_FLAG_SHARED = $00000001;
|
A sharable memory block, usually marked as sharable in the page tables of the memory management unit |
HEAP_FLAG_LOCAL = $00000002;
|
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 |
HEAP_FLAG_CODE = $00000004;
|
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 |
HEAP_FLAG_DEVICE = $00000008;
|
A device memory block, usually marked as device memory in the page tables of the memory management unit |
HEAP_FLAG_NOCACHE = $00000010;
|
A non cached memory block, usually marked as not cacheable in the page tables of the memory management unit |
HEAP_FLAG_NONSHARED = $00000020;
|
A non shared memory block, usually marked as not shareable in the page tables of the memory management unit |
HEAP_FLAG_LOCKED = $00000040;
|
A locked memory block (Not currently implemented in Ultibo) |
HEAP_FLAG_IRQ = $00000080;
|
An IRQ allocatable memory block |
HEAP_FLAG_FIQ = $00000100;
|
An FIQ allocatable memory block |
HEAP_FLAG_RECLAIM = $00000200;
|
A reclaimable memory block (eg Disk Cache)(with a registered callback to reclaim as required for normal memory) |
HEAP_FLAG_CUSTOM = $08000000;
|
A custom flag reserved for non standard uses |
HEAP_FLAG_ALL = $FFFFFFFF;
|
Only for use by GetHeapBlockCount/GetHeapBlockMin/GetHeapBlockMax |
HEAP_FLAG_INVALID = $FFFFFFFF;
|
Return value from MemFlags/IRQ/FIQ on invalid |
HEAP_SMALL_*
HEAP_SMALL_MIN = 56;
|
SizeOf(THeapBlock) Minimum size of a small heap block |
HEAP_SMALL_MIN = 32;
|
SizeOf(THeapBlock) Minimum size of a small heap block |
HEAP_SMALL_MAX = SIZE_4K;
|
Maximum size of a small heap block |
HEAP_SMALL_ALIGN = 4;
|
SizeOf(LongWord); Alignment for small heap blocks |
HEAP_SMALL_SHIFT = 2;
|
Size to Index conversion (Divide by 4) |
HEAP_SMALL_LOW = (HEAP_SMALL_MIN div HEAP_SMALL_ALIGN);
|
8 (32-bit) / 14 (64-bit) |
HEAP_SMALL_HIGH = (HEAP_SMALL_MAX div HEAP_SMALL_ALIGN);
|
1024 |
Type definitions
Heap callback
THeapCallback = function(Size:PtrUInt):LongWord;
|
Heap block
PHeapBlock = ^THeapBlock;
THeapBlock = record
Size:PtrUInt;
|
Size of the Heap Block (including the size of this structure) |
State:LongWord;
|
State of the Heap Block (eg HEAP_STATE_FREE) |
Flags:LongWord;
|
Flags of the Heap Block (eg HEAP_FLAG_SHARED) |
Affinity:LongWord;
|
CPU Affinity of the Heap Block (eg CPU_AFFINITY_0) |
Prev:PHeapBlock;
|
Previous Heap Block in list |
Next:PHeapBlock;
|
Next Heap Block in list |
PrevLink:PHeapBlock;
|
Previous Free/Used Block in list |
NextLink:PHeapBlock;
|
Next Free/Used Block in list |
Heap small blocks
PSmallBlocks = ^TSmallBlocks;
TSmallBlocks = array[HEAP_SMALL_LOW..HEAP_SMALL_HIGH] of PHeapBlock;
Heap lock
PHeapLock = ^THeapLock;
THeapLock = record
Lock:THandle;
|
|
IRQLock:THandle;
|
|
FIQLock:THandle;
|
|
AcquireLock:function(Handle:THandle):LongWord;
|
|
ReleaseLock:function(Handle:THandle):LongWord;
|
|
AcquireIRQLock:function(Handle:THandle):LongWord;
|
|
ReleaseIRQLock:function(Handle:THandle):LongWord;
|
|
AcquireFIQLock:function(Handle:THandle):LongWord;
|
|
ReleaseFIQLock:function(Handle:THandle):LongWord;
|
Heap statistics
PHeapStatistics = ^THeapStatistics;
THeapStatistics = record
Get/Alloc/Realloc | |
GetCount:LongWord;
|
|
AllocCount:LongWord;
|
|
ReallocCount:LongWord;
|
|
GetAlignedCount:LongWord;
|
|
AllocAlignedCount:LongWord;
|
|
ReallocAlignedCount:LongWord;
|
|
GetSharedCount:LongWord;
|
|
AllocSharedCount:LongWord;
|
|
ReallocSharedCount:LongWord;
|
|
GetLocalCount:LongWord;
|
|
AllocLocalCount:LongWord;
|
|
ReallocLocalCount:LongWord;
|
|
GetCodeCount:LongWord;
|
|
AllocCodeCount:LongWord;
|
|
ReallocCodeCount:LongWord;
|
|
GetDeviceCount:LongWord;
|
|
AllocDeviceCount:LongWord;
|
|
ReallocDeviceCount:LongWord;
|
|
GetNoCacheCount:LongWord;
|
|
AllocNoCacheCount:LongWord;
|
|
ReallocNoCacheCount:LongWord;
|
|
GetNonSharedCount:LongWord;
|
|
AllocNonSharedCount:LongWord;
|
|
ReallocNonSharedCount:LongWord;
|
|
GetIRQCount:LongWord;
|
|
AllocIRQCount:LongWord;
|
|
ReallocIRQCount:LongWord;
|
|
GetFIQCount:LongWord;
|
|
AllocFIQCount:LongWord;
|
|
ReallocFIQCount:LongWord;
|
|
Free | |
FreeCount:LongWord;
|
|
FreeIRQCount:LongWord;
|
|
FreeFIQCount:LongWord;
|
|
FreeSizeCount:LongWord;
|
|
Size | |
SizeCount:LongWord;
|
|
SizeIRQCount:LongWord;
|
|
SizeFIQCount:LongWord;
|
|
Flags | |
FlagsCount:LongWord;
|
|
FlagsIRQCount:LongWord;
|
|
FlagsFIQCount:LongWord;
|
|
Register | |
RegisterCount:LongWord;
|
|
Reserve | |
ReserveCount:LongWord;
|
|
Request | |
RequestCount:LongWord;
|
|
RequestSharedCount:LongWord;
|
|
RequestLocalCount:LongWord;
|
|
RequestCodeCount:LongWord;
|
|
RequestDeviceCount:LongWord;
|
|
RequestNoCacheCount:LongWord;
|
|
RequestNonSharedCount:LongWord;
|
|
RequestIRQCount:LongWord;
|
|
RequestFIQCount:LongWord;
|
|
Get Internal | |
GetZeroCount:LongWord;
|
|
GetRemainCount:LongWord;
|
|
GetInvalidCount:LongWord;
|
|
GetUnavailableCount:LongWord;
|
|
GetAddFailCount:LongWord;
|
|
GetSplitFailCount:LongWord;
|
|
GetRemoveFailCount:LongWord;
|
|
Realloc Internal | |
ReallocZeroCount:LongWord;
|
|
ReallocSmallerCount:LongWord;
|
|
ReallocLargerCount:LongWord;
|
|
ReallocReleaseCount:LongWord;
|
|
ReallocReleaseBytes:LongWord;
|
|
ReallocAddFailCount:LongWord;
|
|
ReallocSplitFailCount:LongWord;
|
|
ReallocRemoveFailCount:LongWord;
|
|
GetAligned Internal | |
GetAlignedZeroCount:LongWord;
|
|
GetAlignedRemainCount:LongWord;
|
|
GetAlignedInvalidCount:LongWord;
|
|
GetAlignedUndersizeCount:LongWord;
|
|
GetAlignedUnavailableCount:LongWord;
|
|
GetAlignedAddFailCount:LongWord;
|
|
GetAlignedSplitFailCount:LongWord;
|
|
GetAlignedRemoveFailCount:LongWord;
|
|
GetAlignedReleaseCount:LongWord;
|
|
GetAlignedReleaseBytes:LongWord;
|
|
Free Internal | |
FreeInvalidCount:LongWord;
|
|
FreeAddFailCount:LongWord;
|
|
FreeMergeFailCount:LongWord;
|
|
FreeRemoveFailCount:LongWord;
|
|
Size Internal | |
SizeInvalidCount:LongWord;
|
|
Flags Internal | |
FlagsInvalidCount:LongWord;
|
|
Register Internal | |
RegisterInvalidCount:LongWord;
|
|
RegisterAddFailCount:LongWord;
|
|
Reserve Internal | |
ReserveInvalidCount:LongWord;
|
|
ReserveAddFailCount:LongWord;
|
|
ReserveSplitFailCount:LongWord;
|
|
ReserveRemoveFailCount:LongWord;
|
|
ReserveUnavailableCount:LongWord;
|
|
Request Internal | |
RequestInvalidCount:LongWord;
|
|
RequestAddFailCount:LongWord;
|
|
RequestSplitFailCount:LongWord;
|
|
RequestRemoveFailCount:LongWord;
|
|
RequestUnavailableCount:LongWord;
|
|
Split Internal | |
SplitCount:LongWord;
|
|
Merge Internal | |
MergePrevCount:LongWord;
|
|
MergeNextCount:LongWord;
|
|
Block Internal | |
GetSmallCount:LongWord;
|
|
GetLargeCount:LongWord;
|
|
FindFreeCount:LongWord;
|
|
AddSmallCount:LongWord;
|
|
AddLargeCount:LongWord;
|
|
RemoveSmallCount:LongWord;
|
|
RemoveLargeCount:LongWord;
|
|
SmallUnavailableCount:LongWord;
|
Heap snapshot
PHeapSnapshot = ^THeapSnapshot;
THeapSnapshot = record
Snapshot Properties | |
Address:PtrUInt;
|
Address of the Heap Block |
Size:PtrUInt;
|
Size of the Heap Block (including the size of the THeapBlock structure) |
State:LongWord;
|
State of the Heap Block (eg HEAP_STATE_FREE) |
Flags:LongWord;
|
Flags of the Heap Block (eg HEAP_FLAG_SHARED) |
Affinity:LongWord;
|
CPU Affinity of the Heap Block (eg CPU_AFFINITY_0) |
Internal Properties | |
Next:PHeapSnapshot;
|
Next entry in Heap snapshot |
Public variables
None defined
Function declarations
Initialization functions
procedure RegisterMemoryManager;
Note | None documented |
---|
procedure RegisterHeapBlock(Address:Pointer; Size:PtrUInt);
Note | None documented |
---|
function ReserveHeapBlock(Address:Pointer; Size:PtrUInt):Pointer;
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. |
function RequestHeapBlock(Hint:Pointer; Size:PtrUInt; Flags,Affinity:LongWord):Pointer;
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 |
---|---|
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. |
Affinity | The affinity provides the processor affinity mask, a mask of 0 indicates no specific processor |
Return | The return is the heap block that has been registered or nil if the request failed |
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. |
function RequestSharedHeapBlock(Hint:Pointer; Size:PtrUInt):Pointer;
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 |
---|---|
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. |
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) |
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. |
function RequestLocalHeapBlock(Hint:Pointer; Size:PtrUInt; Affinity:LongWord):Pointer;
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 |
---|---|
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. |
Affinity | The affinity provides the processor affinity mask, a mask of 0 indicates no specific processor |
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) |
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. |
function RequestCodeHeapBlock(Hint:Pointer; Size:PtrUInt; Affinity:LongWord):Pointer;
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 |
---|---|
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. |
Affinity | The affinity provides the processor affinity mask, a mask of 0 indicates no specific processor |
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) |
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. |
function RequestDeviceHeapBlock(Hint:Pointer; Size:PtrUInt):Pointer;
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 |
---|---|
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. |
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) |
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. |
function RequestNoCacheHeapBlock(Hint:Pointer; Size:PtrUInt):Pointer;
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 |
---|---|
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. |
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) |
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. |
function RequestNonSharedHeapBlock(Hint:Pointer; Size:PtrUInt):Pointer;
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 |
---|---|
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. |
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) |
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. |
function RequestIRQHeapBlock(Hint:Pointer; Size:PtrUInt; Affinity:LongWord):Pointer;
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 |
---|---|
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. |
Affinity | The affinity provides the processor affinity mask, a mask of 0 indicates no specific processor |
Return | The return is the heap block that has been marked as IRQ or nil if the request failed |
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. |
function RequestFIQHeapBlock(Hint:Pointer; Size:PtrUInt; Affinity:LongWord):Pointer;
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 |
---|---|
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. |
Affinity | The affinity provides the processor affinity mask, a mask of 0 indicates no specific processor |
Return | The return is the heap block that has been marked as FIQ or nil if the request failed |
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. |
Heap functions
function GetMemEx(Size:PtrUInt; Flags,Affinity:LongWord):Pointer;
Note | None documented |
---|
function GetAlignedMem(Size,Alignment:PtrUInt):Pointer; inline;
Note | Alignment must be a power of 2 |
---|
function GetAlignedMemEx(Size,Alignment:PtrUInt; Flags,Affinity:LongWord):Pointer;
Note | Alignment must be a power of 2 |
---|
function GetSharedMem(Size:PtrUInt):Pointer;
Note | None documented |
---|
function GetSharedAlignedMem(Size,Alignment:PtrUInt):Pointer;
Note | Alignment must be a power of 2 |
---|
function GetLocalMem(Size:PtrUInt; Affinity:LongWord):Pointer;
Note | None documented |
---|
function GetLocalAlignedMem(Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Note | Alignment must be a power of 2 |
---|
function GetCodeMem(Size:PtrUInt; Affinity:LongWord):Pointer;
Note | None documented |
---|
function GetCodeAlignedMem(Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Note | Alignment must be a power of 2 |
---|
function GetDeviceMem(Size:PtrUInt):Pointer;
Note | None documented |
---|
function GetDeviceAlignedMem(Size,Alignment:PtrUInt):Pointer;
Note | Alignment must be a power of 2 |
---|
function GetNoCacheMem(Size:PtrUInt):Pointer;
Note | None documented |
---|
function GetNoCacheAlignedMem(Size,Alignment:PtrUInt):Pointer;
Note | Alignment must be a power of 2 |
---|
function GetNonSharedMem(Size:PtrUInt):Pointer;
Note | None documented |
---|
function GetNonSharedAlignedMem(Size,Alignment:PtrUInt):Pointer;
Note | Alignment must be a power of 2 |
---|
function GetIRQMem(Size:PtrUInt; Affinity:LongWord):Pointer;
Note | The memory must be freed using FreeIRQMem |
---|
function GetIRQAlignedMem(Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Note | Alignment must be a power of 2 |
---|---|
Note | The memory must be freed using FreeIRQMem |
function GetFIQMem(Size:PtrUInt; Affinity:LongWord):Pointer;
Note | The memory must be freed using FreeFIQMem |
---|
function GetFIQAlignedMem(Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Note | Alignment must be a power of 2 |
---|---|
Note | The memory must be freed using FreeFIQMem |
function FreeIRQMem(Addr:Pointer):PtrUInt;
Note | None documented |
---|
function FreeFIQMem(Addr:Pointer):PtrUInt;
Note | None documented |
---|
function AllocMemEx(Size:PtrUInt; Flags,Affinity:LongWord):Pointer;
Note | None documented |
---|
function ReAllocMemEx(var Addr:Pointer; Size:PtrUInt; Flags,Affinity:LongWord):Pointer;
Note | None documented |
---|
function AllocAlignedMem(Size,Alignment:PtrUInt):Pointer; inline;
Note | Alignment must be a power of 2 |
---|
function AllocAlignedMemEx(Size,Alignment:PtrUInt; Flags,Affinity:LongWord):Pointer;
Note | Alignment must be a power of 2 |
---|
function ReAllocAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt):Pointer; inline;
Note | Alignment must be a power of 2 |
---|
function ReAllocAlignedMemEx(var Addr:Pointer; Size,Alignment:PtrUInt; Flags,Affinity:LongWord):Pointer;
Note | Alignment must be a power of 2 |
---|
function AllocSharedMem(Size:PtrUInt):Pointer;
Note | None documented |
---|
function AllocSharedAlignedMem(Size,Alignment:PtrUInt):Pointer;
Note | Alignment must be a power of 2 |
---|
function ReAllocSharedMem(var Addr:Pointer; Size:PtrUInt):Pointer;
Note | None documented |
---|
function ReAllocSharedAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt):Pointer;
Note | Alignment must be a power of 2 |
---|
function AllocLocalMem(Size:PtrUInt; Affinity:LongWord):Pointer;
Note | None documented |
---|
function AllocLocalAlignedMem(Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Note | Alignment must be a power of 2 |
---|
function ReAllocLocalMem(var Addr:Pointer; Size:PtrUInt; Affinity:LongWord):Pointer;
Note | None documented |
---|
function ReAllocLocalAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Note | Alignment must be a power of 2 |
---|
function AllocCodeMem(Size:PtrUInt; Affinity:LongWord):Pointer;
Note | None documented |
---|
function AllocCodeAlignedMem(Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Alignment | The alignment must be a multiple of the minimum alignment configuration |
---|
function ReAllocCodeMem(var Addr:Pointer; Size:PtrUInt; Affinity:LongWord):Pointer;
Note | None documented |
---|
function ReAllocCodeAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Note | Alignment must be a power of 2 |
---|
function AllocDeviceMem(Size:PtrUInt):Pointer;
Note | None documented |
---|
function AllocDeviceAlignedMem(Size,Alignment:PtrUInt):Pointer;
Note | Alignment must be a power of 2 |
---|
function ReAllocDeviceMem(var Addr:Pointer; Size:PtrUInt):Pointer;
Note | None documented |
---|
function ReAllocDeviceAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt):Pointer;
Note | Alignment must be a power of 2 |
---|
function AllocNoCacheMem(Size:PtrUInt):Pointer;
Note | None documented |
---|
function AllocNoCacheAlignedMem(Size,Alignment:PtrUInt):Pointer;
Note | Alignment must be a power of 2 |
---|
function ReAllocNoCacheMem(var Addr:Pointer; Size:PtrUInt):Pointer;
Note | None documented |
---|
function ReAllocNoCacheAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt):Pointer;
Note | Alignment must be a power of 2 |
---|
function AllocNonSharedMem(Size:PtrUInt):Pointer;
Note | None documented |
---|
function AllocNonSharedAlignedMem(Size,Alignment:PtrUInt):Pointer;
Note | Alignment must be a power of 2 |
---|
function ReAllocNonSharedMem(var Addr:Pointer; Size:PtrUInt):Pointer;
Note | None documented |
---|
function ReAllocNonSharedAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt):Pointer;
Note | Alignment must be a power of 2 |
---|
function AllocIRQMem(Size:PtrUInt; Affinity:LongWord):Pointer;
Note | The memory must be freed using FreeIRQMem |
---|
function AllocIRQAlignedMem(Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Note | Alignment must be a power of 2 |
---|---|
Note | The memory must be freed using FreeIRQMem |
function ReAllocIRQMem(var Addr:Pointer; Size:PtrUInt; Affinity:LongWord):Pointer;
Note | The memory must be freed using FreeIRQMem |
---|
function ReAllocIRQAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Note | Alignment must be a power of 2 |
---|---|
Note | The memory must be freed using FreeIRQMem |
function AllocFIQMem(Size:PtrUInt; Affinity:LongWord):Pointer;
Note | The memory must be freed using FreeFIQMem |
---|
function AllocFIQAlignedMem(Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Note | Alignment must be a power of 2 |
---|---|
Note | The memory must be freed using FreeFIQMem |
function ReAllocFIQMem(var Addr:Pointer; Size:PtrUInt; Affinity:LongWord):Pointer;
Note | The memory must be freed using FreeFIQMem |
---|
function ReAllocFIQAlignedMem(var Addr:Pointer; Size,Alignment:PtrUInt; Affinity:LongWord):Pointer;
Note | Alignment must be a power of 2 |
---|---|
Note | The memory must be freed using FreeFIQMem |
function SizeFIQMem(Addr:Pointer):PtrUInt;
Note | None documented |
---|
function MemFlags(Addr:Pointer):LongWord;
Note | None documented |
---|
function MemFlagsIRQ(Addr:Pointer):LongWord;
Note | None documented |
---|
function MemFlagsFIQ(Addr:Pointer):LongWord;
Note | None documented |
---|
function GetHeapStatistics:THeapStatistics;
Note | None documented |
---|
function GetHeapBlockCount(State:LongWord):LongWord;
Note | None documented |
---|
function GetHeapBlockCountEx(State,Flags,Affinity:LongWord):LongWord;
Note | This uses the block list (not the Free/Used/Small lists) in order to account for all blocks |
---|
function GetHeapBlockMin(State:LongWord):LongWord;
Note | None documented |
---|
function GetHeapBlockMinEx(State,Flags,Affinity:LongWord):LongWord;
Note | This uses the block list (not the Free/Used/Small lists) in order to account for all blocks |
---|
function GetHeapBlockMax(State:LongWord):LongWord;
Note | None documented |
---|
function GetHeapBlockMaxEx(State,Flags,Affinity:LongWord):LongWord;
Note | This uses the block list (not the Free/Used/Small lists) in order to account for all blocks |
---|
function CreateHeapSnapshot(State:LongWord):PHeapSnapshot;
Note | None documented |
---|
function CreateHeapSnapshotEx(State,Flags,Affinity:LongWord):PHeapSnapshot;
Note | None documented |
---|
function DestroyHeapSnapshot(Snapshot:PHeapSnapshot):LongWord;
Note | None documented |
---|
Internal functions
function GetHeapBlock(Address:Pointer):PHeapBlock;
Note | Address has already been normalized to include the Heap Block
Caller must hold the heap lock |
---|
function FindHeapBlock(Address:Pointer; Size:PtrUInt):PHeapBlock;
Note | Address has already been normalized to include the Heap Block
Caller must hold the heap lock |
---|
function AddHeapBlock(Block:PHeapBlock):Boolean;
Note | Caller must hold the heap lock |
---|
function SplitHeapBlock(Block:PHeapBlock; Size:PtrUInt):PHeapBlock;
Return | Return The return is the split portion of the block |
---|---|
Note | Caller must remove block from the free list. Caller must add split block to the free list.
Caller must hold the heap lock |
function MergeHeapBlock(Block:PHeapBlock):PHeapBlock;
Return | The return is the merged result of the blocks |
---|---|
Note | Caller must remove block from the free list. Caller must add merged block to the free list.
Caller must hold the heap lock |
function function GetFreeBlock(Size:PtrUInt):PHeapBlock; inline;(Size:PtrUInt):PHeapBlock; inline;
Size | The size has already been normalized to alignment and includes the size of the Heap Block |
---|---|
Note | Caller must hold the heap lock |
function GetFreeBlockEx(Size:PtrUInt; Flags,Affinity:LongWord):PHeapBlock;
Size | The size has already been normalized to alignment and includes the size of the Heap Block |
---|---|
Note | Caller must hold the heap lock |
function FindFreeBlock(Size:PtrUInt):PHeapBlock;
Size | The size is the exact size and has not been normalized |
---|---|
Note | Caller must hold the heap lock |
function AddFreeBlock(Block:PHeapBlock):Boolean;
Note | Caller must hold the heap lock |
---|
function RemoveFreeBlock(Block:PHeapBlock):Boolean;
Note | Caller must hold the heap lock |
---|
function GetUsedBlock(Address:Pointer):PHeapBlock;
Address | The address has already been normalized to include the Heap Block |
---|---|
Note | Caller must hold the heap lock |
function CheckUsedBlock(Address:Pointer):Boolean; inline;
Address | The address has already been normalized to include the Heap Block |
---|---|
Note | Caller must hold the heap lock |
function AddUsedBlock(Block:PHeapBlock):Boolean;
Note | Caller must hold the heap lock |
---|
function RemoveUsedBlock(Block:PHeapBlock):Boolean;
Note | Caller must hold the heap lock |
---|
function GetIRQBlock(Address:Pointer):PHeapBlock;
Address | The address has already been normalized to include the IRQ Heap Block |
---|---|
Note | Caller must hold the IRQ heap lock |
function CheckIRQBlock(Address:Pointer):Boolean;
Address | The address has already been normalized to include the IRQ Heap Block |
---|---|
Note | Caller must hold the IRQ heap lock |
function AddIRQBlock(Block:PHeapBlock):Boolean;
Note | Caller must hold the IRQ heap lock |
---|
function SplitIRQBlock(Block:PHeapBlock; Size:PtrUInt):PHeapBlock;
Return | The return is the split portion of the block |
---|---|
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 |
function MergeIRQBlock(Block:PHeapBlock):PHeapBlock;
Return | The return is the merged result of the blocks |
---|---|
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 |
function GetFreeIRQBlock(Size:PtrUInt; Affinity:LongWord):PHeapBlock;
Size | The size has already been normalized to alignment and includes the size of the IRQ Heap Block |
---|---|
Note | Caller must hold the IRQ heap lock |
function AddFreeIRQBlock(Block:PHeapBlock):Boolean;
Note | Caller must hold the IRQ heap lock |
---|
function RemoveFreeIRQBlock(Block:PHeapBlock):Boolean;
Note | Caller must hold the IRQ heap lock |
---|
function GetFIQBlock(Address:Pointer):PHeapBlock;
Address | The address has already been normalized to include the FIQ Heap Block |
---|---|
Note | Caller must hold the FIQ heap lock |
function CheckFIQBlock(Address:Pointer):Boolean;
Address | The address has already been normalized to include the FIQ Heap Block |
---|---|
Note | Caller must hold the FIQ heap lock |
function AddFIQBlock(Block:PHeapBlock):Boolean;
Note | Caller must hold the FIQ heap lock |
---|
function SplitFIQBlock(Block:PHeapBlock; Size:PtrUInt):PHeapBlock;
Return | The return is the split portion of the block |
---|---|
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 |
function MergeFIQBlock(Block:PHeapBlock):PHeapBlock;
Return | The return is the merged result of the blocks |
---|---|
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 |
function GetFreeFIQBlock(Size:PtrUInt; Affinity:LongWord):PHeapBlock;
Size | The size has already been normalized to alignment and includes the size of the FIQ Heap Block |
---|---|
Note | Caller must hold the FIQ heap lock |
function AddFreeFIQBlock(Block:PHeapBlock):Boolean;
Note | Caller must hold the FIQ heap lock |
---|
function RemoveFreeFIQBlock(Block:PHeapBlock):Boolean;
Note | Caller must hold the FIQ heap lock |
---|
RTL heap manager functions
function SysGetMem(Size:PtrUInt):Pointer; inline;
Note | None documented |
---|
function SysFreeMem(Addr:Pointer):PtrUInt;
Note | None documented |
---|
function SysFreeMemSize(Addr:Pointer; Size:PtrUInt):PtrUInt;
Note | Size is not currently used |
---|
function SysAllocMem(Size:PtrUInt):Pointer;
Note | Not inlined to AllocMemEx to save extra call from memory manager |
---|
function SysReAllocMem(var Addr:Pointer; Size:PtrUInt):Pointer; inline;
Note | None documented |
---|
function SysSizeMem(Addr:Pointer):PtrUInt;
Note | None documented |
---|
procedure SysInitThread;
Note | None documented |
---|
procedure SysDoneThread;
Note | None documented |
---|
procedure SysRelocateHeap;
Note | None documented |
---|
function SysGetHeapStatus:THeapStatus;
Note | None documented |
---|
function SysGetFPCHeapStatus:TFPCHeapStatus;
Note | None documented |
---|
Helper functions
procedure AcquireHeapLock; inline;
Note | None documented |
---|
procedure ReleaseHeapLock; inline;
Note | None documented |
---|
procedure AcquireHeapIRQLock; inline;
Note | None documented |
---|
procedure ReleaseHeapIRQLock; inline;
Note | None documented |
---|
procedure AcquireHeapFIQLock; inline;
Note | None documented |
---|
procedure ReleaseHeapFIQLock; inline;
Note | None documented |
---|
procedure RegisterHeapLock(const Lock:THeapLock);
Note | None documented |
---|
function HeapStateToString(State:LongWord):String;
Note | None documented |
---|
Return to Unit Reference