Ignore:
Timestamp:
Jan 1, 2017, 12:59:53 AM (8 years ago)
Author:
chronos
Message:
  • Modified: Show only really used memory.
  • Added: Check memory leaks in Debug build mode.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        55LazFuck
        66compiled
         7heaptrclog.trc
  • trunk/Forms/UFormMemory.pas

    r67 r78  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   ComCtrls;
     9  ComCtrls, Math;
    1010
    1111const
     
    4242  if Core.CurrentTarget is TTargetInterpretter then
    4343  with TTargetInterpretter(Core.CurrentTarget) do begin
    44     ListViewMemory.Items.Count := Trunc(Length(Memory) / RowSize);
     44    ListViewMemory.Items.Count := Ceil(MemoryMaxUsed / RowSize);
    4545    ListViewMemory.Refresh;
    4646  end;
     
    5454  if Core.CurrentTarget is TTargetInterpretter then
    5555  with TTargetInterpretter(Core.CurrentTarget) do
    56   if (Item.Index >= 0) and (Item.Index < Trunc(Length(Memory) / RowSize)) then begin
     56  if (Item.Index >= 0) and (Item.Index <= Trunc(MemoryMaxUsed / RowSize)) then begin
    5757    Item.Caption := IntToHex(Item.Index * RowSize, 8);
    5858    Row := '';
    5959    for I := 0 to RowSize - 1 do
    60       Row := Row + ' ' + IntToHex(Memory[Item.Index * RowSize + I], 2);
     60      if (Item.Index * RowSize + I) < MemoryMaxUsed then
     61        Row := Row + ' ' + IntToHex(Memory[Item.Index * RowSize + I], 2);
    6162    Item.SubItems.Add(Row);
    6263  end;
Note: See TracChangeset for help on using the changeset viewer.