fpc/rtl/embedded/heapmgr.pp
florian 375f83c874 * moved heap manager on embedded systems into a separate unit
* moved console io on embedded systems into a seperate unit, this unit might setup input/output e.g. to be redirected to a serial port
* cleanup of the embedded system unit

git-svn-id: trunk@19168 -
2011-09-21 20:57:37 +00:00

67 lines
1.7 KiB
ObjectPascal

{
This file is part of the Free Pascal run time library.
Copyright (c) 2011 by the Free Pascal development team.
Heap manager for the FPC embedded target
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.
**********************************************************************}
{$mode objfpc}
Unit heapmgr;
interface
implementation
var
Memorymanager: TMemoryManager;external name 'FPC_SYSTEM_MEMORYMANAGER';
Procedure HandleError (Errno : longint);external name 'FPC_HANDLEERROR';
{*****************************************************************************
OS Memory allocation / deallocation
****************************************************************************}
function SysOSAlloc(size: ptruint): pointer;
begin
result:=nil; // pointer($02000000);
end;
procedure SysOSFree(p: pointer; size: ptruint);
begin
end;
{$define FPC_IN_HEAPMGR}
{$i heap.inc}
const
MyMemoryManager: TMemoryManager = (
NeedLock: false; // Obsolete
GetMem: @SysGetMem;
FreeMem: @SysFreeMem;
FreeMemSize: @SysFreeMemSize;
AllocMem: @SysAllocMem;
ReAllocMem: @SysReAllocMem;
MemSize: @SysMemSize;
InitThread: nil;
DoneThread: nil;
RelocateHeap: nil;
GetHeapStatus: @SysGetHeapStatus;
GetFPCHeapStatus: @SysGetFPCHeapStatus;
);
initialization
SetMemoryManager(MyMemoryManager);
InitHeap;
finalization
FinalizeHeap;
end.