+ added RegisterTinyHeapBlock_Simple_Prealigned procedure, which is the same as

RegisterTinyHeapBlock_Simple, but expects its address and size parameters to
  be already aligned on a TinyHeapAllocGranularity boundary

git-svn-id: trunk@28651 -
This commit is contained in:
nickysn 2014-09-13 15:35:46 +00:00
parent be9e44a821
commit bb07318386

View File

@ -316,6 +316,20 @@
HeapEnd:=Pointer(TTinyHeapPointerArithmeticType(AAddress)+ASize);
end;
{ Strongly simplified version of RegisterTinyHeapBlock, which can be used when
the heap is only a single contiguous memory block and the address and size
are already aligned on a TinyHeapAllocGranularity boundary. }
procedure RegisterTinyHeapBlock_Simple_Prealigned(AAddress: Pointer; ASize: PtrUInt);
begin
{$ifdef DEBUG_TINY_HEAP}
Writeln('RegisterTinyHeapBlock_Simple_Prealigned(', HexStr(AAddress), ',', ASize, ')');
{$endif DEBUG_TINY_HEAP}
HeapOrg:=AAddress;
HeapPtr:=AAddress;
FreeList:=AAddress;
HeapEnd:=Pointer(TTinyHeapPointerArithmeticType(AAddress)+ASize);
end;
procedure RegisterTinyHeapBlock(AAddress: pointer; ASize: ptruint);
var
alignment_inc: smallint;