mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 18:29:27 +02:00
+ added the TP7-compatible pointer variables HeapOrg and HeapEnd, indicating,
respectively, the start and end of the tiny heap. Eventually they are also going to be used for catching attempts to free memory that is outside the heap. git-svn-id: trunk@28437 -
This commit is contained in:
parent
e6017bceed
commit
9979aa702f
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8287,6 +8287,7 @@ rtl/inc/thread.inc svneol=native#text/plain
|
||||
rtl/inc/threadh.inc svneol=native#text/plain
|
||||
rtl/inc/threadvr.inc svneol=native#text/plain
|
||||
rtl/inc/tinyheap.inc svneol=native#text/plain
|
||||
rtl/inc/tnyheaph.inc svneol=native#text/plain
|
||||
rtl/inc/typefile.inc svneol=native#text/plain
|
||||
rtl/inc/ufloat128.pp svneol=native#text/plain
|
||||
rtl/inc/ustringh.inc svneol=native#text/plain
|
||||
|
@ -271,6 +271,10 @@
|
||||
Inc(AAddress,alignment_inc);
|
||||
Dec(ASize,alignment_inc);
|
||||
Dec(ASize,ASize mod TinyHeapAllocGranularity);
|
||||
if (HeapOrg=nil) or (TTinyHeapPointerArithmeticType(HeapOrg) > TTinyHeapPointerArithmeticType(AAddress)) then
|
||||
HeapOrg:=AAddress;
|
||||
if (HeapEnd=nil) or (TTinyHeapPointerArithmeticType(HeapEnd) < (TTinyHeapPointerArithmeticType(AAddress)+ASize)) then
|
||||
HeapEnd:=Pointer(TTinyHeapPointerArithmeticType(AAddress)+ASize);
|
||||
InternalTinyFreeMem(AAddress, ASize);
|
||||
end;
|
||||
|
||||
|
19
rtl/inc/tnyheaph.inc
Normal file
19
rtl/inc/tnyheaph.inc
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
This file is part of the Free Pascal run time library.
|
||||
Copyright (c) 2014 by the Free Pascal development team.
|
||||
|
||||
Tiny heap manager for the i8086 near heap, embedded targets, etc.
|
||||
|
||||
See the file COPYING.FPC, included in this distribution,
|
||||
for details about the copyright.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
**********************************************************************}
|
||||
|
||||
var
|
||||
{ these vars are TP7-compatible }
|
||||
HeapOrg: Pointer = nil; { start of heap }
|
||||
HeapEnd: Pointer = nil; { end of heap }
|
@ -14,6 +14,7 @@ interface
|
||||
$mode switch is not effective }
|
||||
|
||||
{$I systemh.inc}
|
||||
{$I tnyheaph.inc}
|
||||
|
||||
const
|
||||
LineEnding = #13#10;
|
||||
|
Loading…
Reference in New Issue
Block a user