[fpc-pascal] First Test of FastMM4 for fpc

Adrian Veith adrian at veith-system.de
Fri Dec 16 09:29:12 CET 2005



Micha Nelissen schrieb:
> On Thu, 15 Dec 2005 18:21:18 +0100
> Adrian Veith <adrian at veith-system.de> wrote:
>
>   
>> I have changed the FastMM4 that it seemd to work with fpc now. Here are 
>> the results of my prior tests now with FastMM4 for fpc:
>>     
>
> How did you fix FastReallocMem? FPC uses a 'var APointer', but delphi
> doesn't, apparantly.
>
> Are you using the assembly optimized routines here ?
>   

I wrote a small wrapper for ReallocMem.

{$ifdef fpc}
function FastReallocMemFP(var APointer: Pointer; ANewSize: Integer): 
Pointer;
begin
  if APointer = nil then
    Result:= FastAllocMem(ANewSize)
  else
    Result:= FastReallocMem(APointer, ANewSize);
  APointer:= Result;
end;
{$endif}

In my tests I use the asm routines, but the pascal routines work as 
well. Only the Debug-routines don't work (or need some overwork), 
because they access the vmt, which is different in delphi and fpc.


Adrian Veith.



More information about the fpc-pascal mailing list