mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 10:39:18 +02:00
* the FPC_HEAP_HUGE define renamed FPC_TINYHEAP_HUGE, because it applies to the
tiny heap, not the regular one git-svn-id: trunk@28665 -
This commit is contained in:
parent
624b3204d8
commit
706a1d8712
@ -26,34 +26,34 @@
|
|||||||
|
|
||||||
{$ifdef cpui8086}
|
{$ifdef cpui8086}
|
||||||
{$if defined(FPC_X86_DATA_FAR) or defined(FPC_X86_DATA_HUGE)}
|
{$if defined(FPC_X86_DATA_FAR) or defined(FPC_X86_DATA_HUGE)}
|
||||||
{$define FPC_HEAP_HUGE}
|
{$define FPC_TINYHEAP_HUGE}
|
||||||
{$endif}
|
{$endif}
|
||||||
{$endif cpui8086}
|
{$endif cpui8086}
|
||||||
|
|
||||||
{$ifdef FPC_HEAP_HUGE}
|
{$ifdef FPC_TINYHEAP_HUGE}
|
||||||
{$HugePointerArithmeticNormalization On}
|
{$HugePointerArithmeticNormalization On}
|
||||||
{$HugePointerComparisonNormalization On}
|
{$HugePointerComparisonNormalization On}
|
||||||
{$endif FPC_HEAP_HUGE}
|
{$endif FPC_TINYHEAP_HUGE}
|
||||||
|
|
||||||
type
|
type
|
||||||
{ TTinyHeapMemBlockSize holds the size of an *allocated* memory block,
|
{ TTinyHeapMemBlockSize holds the size of an *allocated* memory block,
|
||||||
and is written at position:
|
and is written at position:
|
||||||
memblockstart-sizeof(TTinyHeapMemBlockSize) }
|
memblockstart-sizeof(TTinyHeapMemBlockSize) }
|
||||||
PTinyHeapMemBlockSize = ^TTinyHeapMemBlockSize; {$ifdef FPC_HEAP_HUGE}huge;{$endif}
|
PTinyHeapMemBlockSize = ^TTinyHeapMemBlockSize; {$ifdef FPC_TINYHEAP_HUGE}huge;{$endif}
|
||||||
TTinyHeapMemBlockSize = PtrUInt;
|
TTinyHeapMemBlockSize = PtrUInt;
|
||||||
|
|
||||||
{ TTinyHeapFreeBlockSize holds the size of a *free* memory block, as a
|
{ TTinyHeapFreeBlockSize holds the size of a *free* memory block, as a
|
||||||
part of the TTinyHeapBlock structure }
|
part of the TTinyHeapBlock structure }
|
||||||
{$ifdef FPC_HEAP_HUGE}
|
{$ifdef FPC_TINYHEAP_HUGE}
|
||||||
TTinyHeapFreeBlockSize = record
|
TTinyHeapFreeBlockSize = record
|
||||||
OfsSize: Word;
|
OfsSize: Word;
|
||||||
SegSize: Word;
|
SegSize: Word;
|
||||||
end;
|
end;
|
||||||
{$else FPC_HEAP_HUGE}
|
{$else FPC_TINYHEAP_HUGE}
|
||||||
TTinyHeapFreeBlockSize = PtrUInt;
|
TTinyHeapFreeBlockSize = PtrUInt;
|
||||||
{$endif FPC_HEAP_HUGE}
|
{$endif FPC_TINYHEAP_HUGE}
|
||||||
|
|
||||||
TTinyHeapPointerArithmeticType = ^Byte; {$ifdef FPC_HEAP_HUGE}huge;{$endif}
|
TTinyHeapPointerArithmeticType = ^Byte; {$ifdef FPC_TINYHEAP_HUGE}huge;{$endif}
|
||||||
|
|
||||||
PTinyHeapBlock = ^TTinyHeapBlock;
|
PTinyHeapBlock = ^TTinyHeapBlock;
|
||||||
TTinyHeapBlock = record
|
TTinyHeapBlock = record
|
||||||
@ -68,21 +68,21 @@
|
|||||||
|
|
||||||
function EncodeTinyHeapFreeBlockSize(Size: PtrUInt): TTinyHeapFreeBlockSize; inline;
|
function EncodeTinyHeapFreeBlockSize(Size: PtrUInt): TTinyHeapFreeBlockSize; inline;
|
||||||
begin
|
begin
|
||||||
{$ifdef FPC_HEAP_HUGE}
|
{$ifdef FPC_TINYHEAP_HUGE}
|
||||||
EncodeTinyHeapFreeBlockSize.OfsSize := Size and 15;
|
EncodeTinyHeapFreeBlockSize.OfsSize := Size and 15;
|
||||||
EncodeTinyHeapFreeBlockSize.SegSize := Size shr 4;
|
EncodeTinyHeapFreeBlockSize.SegSize := Size shr 4;
|
||||||
{$else FPC_HEAP_HUGE}
|
{$else FPC_TINYHEAP_HUGE}
|
||||||
EncodeTinyHeapFreeBlockSize := Size;
|
EncodeTinyHeapFreeBlockSize := Size;
|
||||||
{$endif FPC_HEAP_HUGE}
|
{$endif FPC_TINYHEAP_HUGE}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function DecodeTinyHeapFreeBlockSize(Size: TTinyHeapFreeBlockSize): PtrUInt; inline;
|
function DecodeTinyHeapFreeBlockSize(Size: TTinyHeapFreeBlockSize): PtrUInt; inline;
|
||||||
begin
|
begin
|
||||||
{$ifdef FPC_HEAP_HUGE}
|
{$ifdef FPC_TINYHEAP_HUGE}
|
||||||
DecodeTinyHeapFreeBlockSize := (PtrUInt(Size.SegSize) shl 4) + Size.OfsSize;
|
DecodeTinyHeapFreeBlockSize := (PtrUInt(Size.SegSize) shl 4) + Size.OfsSize;
|
||||||
{$else FPC_HEAP_HUGE}
|
{$else FPC_TINYHEAP_HUGE}
|
||||||
DecodeTinyHeapFreeBlockSize := Size;
|
DecodeTinyHeapFreeBlockSize := Size;
|
||||||
{$endif FPC_HEAP_HUGE}
|
{$endif FPC_TINYHEAP_HUGE}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure InternalTinyFreeMem(Addr: Pointer; Size: PtrUInt); forward;
|
procedure InternalTinyFreeMem(Addr: Pointer; Size: PtrUInt); forward;
|
||||||
|
Loading…
Reference in New Issue
Block a user