Unit HeapManager

From Ultibo.org
Revision as of 04:48, 18 August 2016 by Ultibo (Talk | contribs)

Jump to: navigation, search

Return to Unit Reference


Description


To be documented

Constants


To be documented

Type definitions


To be documented

Public variables


To be documented

Function declarations



Initialization functions

procedure RegisterMemoryManager;
Description: To be documented
Note To be documented


procedure RegisterHeapBlock(Address:Pointer; Size:PtrUInt);
Description: To be documented
Note To be documented


function RequestHeapBlock(Hint:Pointer; Size:PtrUInt; Flags,Affinity:LongWord):Pointer;
Description: Request registration a Heap Block with specified flags and affinity within an existing block
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;
Description: Request registration of a Shared Heap Block within an existing block
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;
Description: Request registration of a Local Heap Block within an existing block
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;
Description: Request registration of a Code Heap Block within an existing block
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;
Description: Request registration of a Device Heap Block within an existing block
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;
Description: Request registration of a Non Cached Heap Block within an existing block
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;
Description: Request registration of a Non Shared Heap Block within an existing block
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;
Description: Request registration of an IRQ Heap Block within an existing block
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;
Description: Request registration of an FIQ Heap Block within an existing block
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.



Return to Unit Reference