[bug_fixed] TZTestSysUtilsCase.TestDebug

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
mariuszekpl
Senior Boarder
Senior Boarder
Posts: 54
Joined: 30.09.2008, 10:59

[bug_fixed] TZTestSysUtilsCase.TestDebug

Post by mariuszekpl »

Seems like GetMem allocates using blocks of 8 bytes + 4 bytes extra at start

Code: Select all

procedure TZTestSysUtilsCase.TestDebug;
var
  temp:Pointer;
begin
   CheckEquals(True, debug_get_memorydiff>0);
   CheckEquals(0, debug_get_memorydiff);
   GetMem(Temp,5);
   FreeMem(Temp,5);
   CheckEquals(0, debug_get_memorydiff);
   GetMem(Temp,4);
{$IFDEF DELPHI12_UP}
   { Seems like GetMem allocates using blocks of 8 bytes  + 4 bytes extra at start}
   CheckEquals(12, debug_get_memorydiff);
{$ELSE}
   { Seems like GetMem allocates using blocks of 8 bytes}
   CheckEquals(8, debug_get_memorydiff);
{$ENDIF}


   FreeMem(Temp,4);
{$IFDEF DELPHI12_UP}
   CheckEquals(-12, debug_get_memorydiff);
{$ELSE}
   CheckEquals(-8, debug_get_memorydiff);
{$ENDIF}
end;
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

removed debug_get_memorydiff completely... Wasn't very uniform among different compilers.
Locked