update to 0.7.0

This commit is contained in:
Razor12911
2023-04-29 22:51:51 +02:00
parent 552a733296
commit 50c7c248da
144 changed files with 42115 additions and 22130 deletions

View File

@@ -0,0 +1,44 @@
object Form1: TForm1
Left = 0
Top = 0
Caption = 'borlndmm.dll using FullDebugMode'
ClientHeight = 146
ClientWidth = 369
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 24
Top = 24
Width = 321
Height = 25
Caption = 'Click this button to leak a TObject'
TabOrder = 0
OnClick = Button1Click
end
object Button2: TButton
Left = 24
Top = 60
Width = 321
Height = 25
Caption = 'Click this button to test the allocation grouping functionality'
TabOrder = 1
OnClick = Button2Click
end
object Button3: TButton
Left = 24
Top = 96
Width = 321
Height = 25
Caption = 'Cause a "virtual method on freed object" error'
TabOrder = 2
OnClick = Button3Click
end
end

View File

@@ -0,0 +1,76 @@
unit DemoForm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, FastMMDebugSupport, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
TObject.Create;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
x, y, z: TObject;
begin
{Set the allocation group to 1}
PushAllocationGroup(1);
{Allocate an object}
x := TPersistent.Create;
{Set the allocation group to 2}
PushAllocationGroup(2);
{Allocate a TControl}
y := TControl.Create(nil);
{Go back to allocation group 1}
PopAllocationGroup;
{Allocate a TWinControl}
z := TWinControl.Create(nil);
{Pop the last group off the stack}
PopAllocationGroup;
{Specify the name of the log file}
SetMMLogFileName('AllocationGroupTest.log');
{Log all live blocks in groups 1 and 2}
LogAllocatedBlocksToFile(1, 2);
{Restore the default log file name}
SetMMLogFileName(nil);
{Free all the objects}
x.Free;
y.Free;
z.Free;
{Done}
ShowMessage('Allocation detail logged to file.');
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
with TObject.Create do
begin
Free;
Free;
end;
end;
end.

View File

@@ -0,0 +1,15 @@
program FullDebugModeDemo;
uses
ShareMem,
Forms,
DemoForm in 'DemoForm.pas' {Form1},
FastMMDebugSupport in '..\..\Replacement BorlndMM DLL\Delphi\FastMMDebugSupport.pas';
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.