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,9 @@
USEUNIT("DLLEntry.cpp");
USEUNIT("FastMM4BCB.cpp");
USEUNIT("FastMM4.pas");
USEUNIT("BorlndMM_.pas");
USEDEF("Export.def");
//---------------------------------------------------------------------------
This file is used by the project manager only and should be treated like the project file

View File

@@ -0,0 +1,118 @@
<?xml version='1.0' encoding='utf-8' ?>
<!-- C++Builder XML Project -->
<PROJECT>
<MACROS>
<VERSION value="BCB.05.03"/>
<PROJECT value="BorlndMM.dll"/>
<OBJFILES value="FastMM4.obj BorlndMM_.obj DLLEntry.obj FastMM4BCB.obj"/>
<RESFILES value=""/>
<IDLFILES value=""/>
<IDLGENFILES value=""/>
<DEFFILE value="Export.def"/>
<RESDEPEN value="$(RESFILES)"/>
<LIBFILES value=""/>
<LIBRARIES value="Vcl50.lib"/>
<SPARELIBS value="Vcl50.lib"/>
<PACKAGES value="Vcl50.bpi Vclx50.bpi bcbsmp50.bpi Vcldb50.bpi vclado50.bpi ibsmp50.bpi
VCLBDE50.bpi vcldbx50.bpi Qrpt50.bpi TeeUI50.bpi TeeDB50.bpi Tee50.bpi
Dss50.bpi TeeQR50.bpi VCLIB50.bpi Vclmid50.bpi vclie50.bpi Inetdb50.bpi
Inet50.bpi NMFast50.bpi webmid50.bpi bcbie50.bpi dclocx50.bpi
bcb2kaxserver50.bpi"/>
<PATHCPP value=".;"/>
<PATHPAS value=".;"/>
<PATHRC value=".;"/>
<PATHASM value=".;"/>
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
<RELEASELIBPATH value="$(BCB)\lib\release"/>
<LINKER value="tlink32"/>
<USERDEFINES value="_DEBUG"/>
<SYSDEFINES value="NO_STRICT;_NO_VCL"/>
<MAINSOURCE value="BorlndMM.bpf"/>
<INCLUDEPATH value="$(BCB)\include;$(BCB)\include\vcl"/>
<LIBPATH value="$(BCB)\lib\obj;$(BCB)\lib"/>
<WARNINGS value="-w-par"/>
</MACROS>
<OPTIONS>
<IDLCFLAGS value="-I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -D_DEBUG -boa"/>
<CFLAG1 value="-WD -O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -r- -a8 -b- -k- -y -v -vi-
-tWD -tWM -c"/>
<PFLAGS value="-$YD -v -JPHNE -M"/>
<RFLAGS value=""/>
<AFLAGS value="/mx /w2 /zi"/>
<LFLAGS value="-D&quot;&quot; -B:0x41000000 -aa -Tpd -x -Gn -v"/>
</OPTIONS>
<LINKER>
<ALLOBJ value="c0d32.obj $(OBJFILES)"/>
<ALLRES value="$(RESFILES)"/>
<ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cw32mt.lib"/>
</LINKER>
<IDEOPTIONS>
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=2052
CodePage=936
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
[HistoryLists\hlIncludePath]
Count=1
Item0=$(BCB)\include;$(BCB)\include\vcl
[HistoryLists\hlLibraryPath]
Count=1
Item0=$(BCB)\lib\obj;$(BCB)\lib
[HistoryLists\hlDebugSourcePath]
Count=1
Item0=$(BCB)\source\vcl
[HistoryLists\hlConditionals]
Count=1
Item0=_DEBUG
[Debugging]
DebugSourceDirs=$(BCB)\source\vcl
[Parameters]
RunParams=
HostApplication=F:\FastMM492\FastMM4\Replacement BorlndMM DLL\BCB5\Project1.exe
RemoteHost=
RemotePath=
RemoteDebug=0
[Compiler]
ShowInfoMsgs=0
LinkDebugVcl=1
LinkCGLIB=0
[CORBA]
AddServerUnit=1
AddClientUnit=1
PrecompiledHeaders=1
[Language]
ActiveLang=
ProjectLang=
RootDir=
</IDEOPTIONS>
</PROJECT>

View File

@@ -0,0 +1,254 @@
unit BorlndMM_;
interface
{--------------------Start of options block-------------------------}
{Set the following option to use the RTL MM instead of FastMM. Setting this
option makes this replacement DLL almost identical to the default
borlndmm.dll, unless the "FullDebugMode" option is also set.}
{.$define UseRTLMM}
{--------------------End of options block-------------------------}
{$Include FastMM4Options.inc}
{Cannot use the RTL MM with full debug mode}
{$ifdef FullDebugMode}
{$undef UseRTLMM}
{$endif}
{$OBJEXPORTALL OFF}
function GetAllocMemCount: integer;
function GetAllocMemSize: integer;
procedure DumpBlocks;
function HeapRelease: Integer;
function HeapAddRef: Integer;
function SysReallocMem(P: Pointer; Size: Integer): Pointer;
function SysFreeMem(P: Pointer): Integer;
function SysGetMem(Size: Integer): Pointer;
{$ifdef BDS2006AndUp}
function SysAllocMem(Size: Cardinal): Pointer;
{$endif}
function ReallocMemory(P: Pointer; Size: Integer): Pointer; cdecl;
function FreeMemory(P: Pointer): Integer; cdecl;
function GetMemory(Size: Integer): Pointer; cdecl;
function GetHeapStatus: THeapStatus;
{$ifdef BDS2006AndUp}
function RegisterExpectedMemoryLeak(ALeakedPointer: Pointer): Boolean;
function UnregisterExpectedMemoryLeak(ALeakedPointer: Pointer): Boolean;
{$endif}
implementation
{$ifndef UseRTLMM}
uses
FastMM4;
{$endif}
{$OPTIMIZATION ON}
{$STACKFRAMES OFF}
{$RANGECHECKS OFF}
{$OVERFLOWCHECKS OFF}
{$ifdef NoDebugInfo}
{$DEBUGINFO OFF}
{$endif}
//Export: GetAllocMemCount
//Symbol: @Borlndmm@GetAllocMemCount$qqrv
function GetAllocMemCount: integer;
begin
{Return stats for the RTL MM only}
{$ifdef UseRTLMM}
Result := System.AllocMemCount;
{$else}
Result := 0;
{$endif}
end;
//Export: GetAllocMemSize
//Symbol: @Borlndmm@GetAllocMemSize$qqrv
function GetAllocMemSize: integer;
begin
{Return stats for the RTL MM only}
{$ifdef UseRTLMM}
Result := System.AllocMemSize;
{$else}
Result := 0;
{$endif}
end;
//Export: DumpBlocks
//Symbol: @Borlndmm@DumpBlocks$qqrv
procedure DumpBlocks;
begin
{Do nothing}
end;
//Export: @Borlndmm@HeapRelease$qqrv
//Symbol: @Borlndmm@HeapRelease$qqrv
function HeapRelease: Integer;
begin
{Do nothing}
Result := 2;
end;
//Export: @Borlndmm@HeapAddRef$qqrv
//Symbol: @Borlndmm@HeapAddRef$qqrv
function HeapAddRef: Integer;
begin
{Do nothing}
Result := 2;
end;
//Export: GetHeapStatus
//Symbol: @Borlndmm@GetHeapStatus$qqrv
function GetHeapStatus: THeapStatus;
begin
{$ifndef UseRTLMM}
Result := FastGetHeapStatus;
{$else}
Result := System.GetHeapStatus;
{$endif}
end;
//Export: ReallocMemory
//Symbol: @Borlndmm@ReallocMemory$qpvi
function ReallocMemory(P: Pointer; Size: Integer): Pointer; cdecl;
begin
Result := System.ReallocMemory(P, Size);
end;
//Export: FreeMemory
//Symbol: @Borlndmm@FreeMemory$qpv
function FreeMemory(P: Pointer): Integer; cdecl;
begin
Result := System.FreeMemory(P);
end;
//Export: GetMemory
//Symbol: @Borlndmm@GetMemory$qi
function GetMemory(Size: Integer): Pointer; cdecl;
begin
Result := System.GetMemory(Size);
end;
//Export: @Borlndmm@SysReallocMem$qqrpvi
//Symbol: @Borlndmm@SysReallocMem$qqrpvi
function SysReallocMem(P: Pointer; Size: Integer): Pointer;
begin
{$ifndef UseRTLMM}
{$ifndef FullDebugMode}
Result := FastReallocMem(P, Size);
{$else}
Result := DebugReallocMem(P, Size);
{$endif}
{$else}
Result := System.SysReallocMem(P, Size);
{$endif}
end;
//Export: @Borlndmm@SysFreeMem$qqrpv
//Symbol: @Borlndmm@SysFreeMem$qqrpv
function SysFreeMem(P: Pointer): Integer;
begin
{$ifndef UseRTLMM}
{$ifndef FullDebugMode}
Result := FastFreeMem(P);
{$else}
Result := DebugFreeMem(P);
{$endif}
{$else}
Result := System.SysFreeMem(P);
{$endif}
end;
//Export: @Borlndmm@SysGetMem$qqri
//Symbol: @Borlndmm@SysGetMem$qqri
function SysGetMem(Size: Integer): Pointer;
begin
{$ifndef UseRTLMM}
{$ifndef FullDebugMode}
Result := FastGetMem(Size);
{$else}
Result := DebugGetMem(Size);
{$endif}
{$else}
Result := System.SysGetMem(Size);
{$endif}
end;
//Export: @Borlndmm@SysAllocMem$qqri
//Symbol: @Borlndmm@SysAllocMem$qqrui
function SysAllocMem(Size: Cardinal): Pointer;
begin
{$ifndef UseRTLMM}
{$ifndef FullDebugMode}
Result := FastAllocMem(Size);
{$else}
Result := DebugAllocMem(Size);
{$endif}
{$else}
//{$ifdef VER180}
{$if RTLVersion >= 18}
Result := System.SysAllocMem(Size);
{$ifend}
{$if RTLVersion < 18}
Result := System.AllocMem(Size);
{$ifend}
{$endif}
end;
//Export: @Borlndmm@SysUnregisterExpectedMemoryLeak$qqrpi
//Symbol: @Borlndmm@UnregisterExpectedMemoryLeak$qqrpv
function UnregisterExpectedMemoryLeak(ALeakedPointer: Pointer): Boolean;
begin
{$ifndef UseRTLMM}
{$ifdef EnableMemoryLeakReporting}
Result := UnregisterExpectedMemoryLeak(ALeakedPointer);
{$else}
Result := False;
{$endif}
{$else}
//{$ifdef VER180}
{$if RTLVersion >= 18}
Result := System.SysUnregisterExpectedMemoryLeak(ALeakedPointer);
{$ifend}
{$if RTLVersion < 18}
Result := False;
{$ifend}
{$endif}
end;
//Export: @Borlndmm@SysRegisterExpectedMemoryLeak$qqrpi
//Symbol: @Borlndmm@RegisterExpectedMemoryLeak$qqrpv
function RegisterExpectedMemoryLeak(ALeakedPointer: Pointer): Boolean;
begin
{$ifndef UseRTLMM}
{$ifdef EnableMemoryLeakReporting}
Result := RegisterExpectedMemoryLeak(ALeakedPointer);
{$else}
Result := False;
{$endif}
{$else}
//{$ifdef VER180}
{$if RTLVersion >= 18}
Result := System.SysRegisterExpectedMemoryLeak(ALeakedPointer);
{$ifend}
{$if RTLVersion < 18}
Result := False;
{$ifend}
{$endif}
end;
initialization
IsMultiThread := True;
finalization
end.

View File

@@ -0,0 +1,31 @@
//---------------------------------------------------------------------------
#include <windows.h>
//---------------------------------------------------------------------------
// Important note about DLL memory management when your DLL uses the
// static version of the RunTime Library:
//
// If your DLL exports any functions that pass String objects (or structs/
// classes containing nested Strings) as parameter or function results,
// you will need to add the library MEMMGR.LIB to both the DLL project and
// any other projects that use the DLL. You will also need to use MEMMGR.LIB
// if any other projects which use the DLL will be performing new or delete
// operations on any non-TObject-derived classes which are exported from the
// DLL. Adding MEMMGR.LIB to your project will change the DLL and its calling
// EXE's to use the BORLNDMM.DLL as their memory manager. In these cases,
// the file BORLNDMM.DLL should be deployed along with your DLL.
//
// To avoid using BORLNDMM.DLL, pass string information using "char *" or
// ShortString parameters.
//
// If your DLL uses the dynamic version of the RTL, you do not need to
// explicitly add MEMMGR.LIB as this will be done implicitly for you
//---------------------------------------------------------------------------
#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
return 1;
}
//---------------------------------------------------------------------------

View File

@@ -0,0 +1,29 @@
LIBRARY BORLNDMM.DLL
EXPORTS
GetAllocMemCount = @Borlndmm_@GetAllocMemCount$qqrv ;To make it the 2nd export, ___CPPdebugHook always the 1st export
GetAllocMemSize = @Borlndmm_@GetAllocMemSize$qqrv
GetHeapStatus = @Borlndmm_@GetHeapStatus$qqrv
DumpBlocks = @Borlndmm_@DumpBlocks$qqrv
ReallocMemory = @Borlndmm_@ReallocMemory$qpvi
FreeMemory = @Borlndmm_@FreeMemory$qpv
GetMemory = @Borlndmm_@GetMemory$qi
;@Borlndmm@SysUnregisterExpectedMemoryLeak$qqrpi = @Borlndmm_@UnregisterExpectedMemoryLeak$qqrpv
;@Borlndmm@SysRegisterExpectedMemoryLeak$qqrpi = @Borlndmm_@RegisterExpectedMemoryLeak$qqrpv
;@Borlndmm@SysAllocMem$qqri = @Borlndmm_@SysAllocMem$qqrui
@Borlndmm@SysReallocMem$qqrpvi = @Borlndmm_@SysReallocMem$qqrpvi
@Borlndmm@SysFreeMem$qqrpv = @Borlndmm_@SysFreeMem$qqrpv
@Borlndmm@SysGetMem$qqri = @Borlndmm_@SysGetMem$qqri
@Borlndmm@HeapRelease$qqrv = @Borlndmm_@HeapRelease$qqrv
@Borlndmm@HeapAddRef$qqrv = @Borlndmm_@HeapAddRef$qqrv
;SetMMLogFileName = @Fastmm4@SetMMLogFileName$qqrpc
;GetCurrentAllocationGroup = @Fastmm4@GetCurrentAllocationGroup$qqrv
;PushAllocationGroup = @Fastmm4@PushAllocationGroup$qqrui
;PopAllocationGroup = @Fastmm4@PopAllocationGroup$qqrv
;LogAllocatedBlocksToFile = @Fastmm4@LogAllocatedBlocksToFile$qqruiui

View File

@@ -0,0 +1,3 @@
This file is used by the project manager only and should be treated like the project file

View File

@@ -0,0 +1,140 @@
<?xml version='1.0' encoding='utf-8' ?>
<!-- C++Builder XML Project -->
<PROJECT>
<MACROS>
<VERSION value="BCB.06.00"/>
<PROJECT value="BorlndMM.dll"/>
<OBJFILES value="DLLEntry.obj BorlndMM_.obj FastMM4.obj FastMM4BCB.obj"/>
<RESFILES value="BorlndMM.res"/>
<IDLFILES value=""/>
<IDLGENFILES value=""/>
<DEFFILE value="Export.def"/>
<RESDEPEN value="$(RESFILES)"/>
<LIBFILES value=""/>
<LIBRARIES value=""/>
<SPARELIBS value="vcldb.lib dbrtl.lib adortl.lib bdertl.lib vcldbx.lib ibxpress.lib cds.lib
dsnap.lib bdecds.lib qrpt.lib teeui.lib teedb.lib tee.lib dss.lib
teeqr.lib visualdbclx.lib dsnapcrba.lib dsnapcon.lib bcbsmp.lib"/>
<PACKAGES value="vcl.bpi rtl.bpi dbrtl.bpi adortl.bpi vcldb.bpi vclx.bpi bdertl.bpi
vcldbx.bpi ibxpress.bpi cds.bpi dsnap.bpi bdecds.bpi qrpt.bpi teeui.bpi
teedb.bpi tee.bpi dss.bpi teeqr.bpi visualclx.bpi visualdbclx.bpi
dsnapcrba.bpi dsnapcon.bpi bcbsmp.bpi"/>
<PATHCPP value=".;"/>
<PATHPAS value=".;"/>
<PATHRC value=".;"/>
<PATHASM value=".;"/>
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
<RELEASELIBPATH value="$(BCB)\lib\release"/>
<LINKER value="ilink32"/>
<USERDEFINES value="_DEBUG"/>
<SYSDEFINES value="NO_STRICT;_NO_VCL;USEPACKAGES"/>
<MAINSOURCE value="BorlndMM.bpf"/>
<INCLUDEPATH value="&quot;F:\FastMM492\FastMM4\Replacement BorlndMM DLL\BCB6&quot;;$(BCB)\include;$(BCB)\include\vcl"/>
<LIBPATH value="&quot;F:\FastMM492\FastMM4\Replacement BorlndMM DLL\BCB6&quot;;$(BCB)\lib\obj;$(BCB)\lib"/>
<WARNINGS value="-w-par"/>
<OTHERFILES value=""/>
</MACROS>
<OPTIONS>
<IDLCFLAGS value="-I&quot;F:\FastMM492\FastMM4\Replacement BorlndMM DLL\BCB6&quot; -I$(BCB)\include
-I$(BCB)\include\vcl -src_suffix cpp -D_DEBUG -boa"/>
<CFLAG1 value="-WD -O2 -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -r- -a8 -b- -k- -y -v -vi-
-tWD -tWM -c"/>
<PFLAGS value="-$YD -$W -$O- -$A8 -v -JPHNE -M"/>
<RFLAGS value=""/>
<AFLAGS value="/mx /w2 /zi"/>
<LFLAGS value="-D&quot;&quot; -B:0x1190000 -aa -Tpd -x -Gn -v"/>
<OTHERFILES value=""/>
</OPTIONS>
<LINKER>
<ALLOBJ value="c0d32.obj $(PACKAGES) $(OBJFILES)"/>
<ALLRES value="$(RESFILES)"/>
<ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cw32mt.lib"/>
<OTHERFILES value=""/>
</LINKER>
<FILELIST>
<FILE FILENAME="BorlndMM.res" FORMNAME="" UNITNAME="BorlndMM.res" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="BorlndMM.bpf" FORMNAME="" UNITNAME="BorlndMM" CONTAINERID="BPF" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="DLLEntry.cpp" FORMNAME="" UNITNAME="DLLEntry" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="BorlndMM_.pas" FORMNAME="" UNITNAME="BorlndMM_" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="FastMM4.pas" FORMNAME="" UNITNAME="FastMM4" CONTAINERID="PascalCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="FastMM4BCB.cpp" FORMNAME="" UNITNAME="FastMM4BCB" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/>
<FILE FILENAME="Export.def" FORMNAME="" UNITNAME="Export.def" CONTAINERID="DefTool" DESIGNCLASS="" LOCALCOMMAND=""/>
</FILELIST>
<BUILDTOOLS>
</BUILDTOOLS>
<IDEOPTIONS>
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=2052
CodePage=936
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
[HistoryLists\hlIncludePath]
Count=1
Item0=F:\FastMM492\FastMM4\Replacement BorlndMM DLL\BCB6;$(BCB)\include;$(BCB)\include\vcl
[HistoryLists\hlLibraryPath]
Count=1
Item0=F:\FastMM492\FastMM4\Replacement BorlndMM DLL\BCB6;$(BCB)\lib\obj;$(BCB)\lib
[HistoryLists\hlDebugSourcePath]
Count=1
Item0=$(BCB)\source\vcl
[HistoryLists\hlConditionals]
Count=1
Item0=_DEBUG
[Debugging]
DebugSourceDirs=$(BCB)\source\vcl
[Parameters]
RunParams=
Launcher=
UseLauncher=0
DebugCWD=
HostApplication=
RemoteHost=
RemotePath=
RemoteLauncher=
RemoteCWD=
RemoteDebug=0
[Compiler]
ShowInfoMsgs=0
LinkDebugVcl=1
LinkCGLIB=0
[CORBA]
AddServerUnit=1
AddClientUnit=1
PrecompiledHeaders=1
[Linker]
LibPrefix=
LibSuffix=
LibVersion=
</IDEOPTIONS>
</PROJECT>

View File

@@ -0,0 +1,254 @@
unit BorlndMM_;
interface
{--------------------Start of options block-------------------------}
{Set the following option to use the RTL MM instead of FastMM. Setting this
option makes this replacement DLL almost identical to the default
borlndmm.dll, unless the "FullDebugMode" option is also set.}
{.$define UseRTLMM}
{--------------------End of options block-------------------------}
{$Include FastMM4Options.inc}
{Cannot use the RTL MM with full debug mode}
{$ifdef FullDebugMode}
{$undef UseRTLMM}
{$endif}
{$OBJEXPORTALL OFF}
function GetAllocMemCount: integer;
function GetAllocMemSize: integer;
procedure DumpBlocks;
function HeapRelease: Integer;
function HeapAddRef: Integer;
function SysReallocMem(P: Pointer; Size: Integer): Pointer;
function SysFreeMem(P: Pointer): Integer;
function SysGetMem(Size: Integer): Pointer;
{$ifdef BDS2006AndUp}
function SysAllocMem(Size: Cardinal): Pointer;
{$endif}
function ReallocMemory(P: Pointer; Size: Integer): Pointer; cdecl;
function FreeMemory(P: Pointer): Integer; cdecl;
function GetMemory(Size: Integer): Pointer; cdecl;
function GetHeapStatus: THeapStatus;
{$ifdef BDS2006AndUp}
function RegisterExpectedMemoryLeak(ALeakedPointer: Pointer): Boolean;
function UnregisterExpectedMemoryLeak(ALeakedPointer: Pointer): Boolean;
{$endif}
implementation
{$ifndef UseRTLMM}
uses
FastMM4;
{$endif}
{$OPTIMIZATION ON}
{$STACKFRAMES OFF}
{$RANGECHECKS OFF}
{$OVERFLOWCHECKS OFF}
{$ifdef NoDebugInfo}
{$DEBUGINFO OFF}
{$endif}
//Export: GetAllocMemCount
//Symbol: @Borlndmm@GetAllocMemCount$qqrv
function GetAllocMemCount: integer;
begin
{Return stats for the RTL MM only}
{$ifdef UseRTLMM}
Result := System.AllocMemCount;
{$else}
Result := 0;
{$endif}
end;
//Export: GetAllocMemSize
//Symbol: @Borlndmm@GetAllocMemSize$qqrv
function GetAllocMemSize: integer;
begin
{Return stats for the RTL MM only}
{$ifdef UseRTLMM}
Result := System.AllocMemSize;
{$else}
Result := 0;
{$endif}
end;
//Export: DumpBlocks
//Symbol: @Borlndmm@DumpBlocks$qqrv
procedure DumpBlocks;
begin
{Do nothing}
end;
//Export: @Borlndmm@HeapRelease$qqrv
//Symbol: @Borlndmm@HeapRelease$qqrv
function HeapRelease: Integer;
begin
{Do nothing}
Result := 2;
end;
//Export: @Borlndmm@HeapAddRef$qqrv
//Symbol: @Borlndmm@HeapAddRef$qqrv
function HeapAddRef: Integer;
begin
{Do nothing}
Result := 2;
end;
//Export: GetHeapStatus
//Symbol: @Borlndmm@GetHeapStatus$qqrv
function GetHeapStatus: THeapStatus;
begin
{$ifndef UseRTLMM}
Result := FastGetHeapStatus;
{$else}
Result := System.GetHeapStatus;
{$endif}
end;
//Export: ReallocMemory
//Symbol: @Borlndmm@ReallocMemory$qpvi
function ReallocMemory(P: Pointer; Size: Integer): Pointer; cdecl;
begin
Result := System.ReallocMemory(P, Size);
end;
//Export: FreeMemory
//Symbol: @Borlndmm@FreeMemory$qpv
function FreeMemory(P: Pointer): Integer; cdecl;
begin
Result := System.FreeMemory(P);
end;
//Export: GetMemory
//Symbol: @Borlndmm@GetMemory$qi
function GetMemory(Size: Integer): Pointer; cdecl;
begin
Result := System.GetMemory(Size);
end;
//Export: @Borlndmm@SysReallocMem$qqrpvi
//Symbol: @Borlndmm@SysReallocMem$qqrpvi
function SysReallocMem(P: Pointer; Size: Integer): Pointer;
begin
{$ifndef UseRTLMM}
{$ifndef FullDebugMode}
Result := FastReallocMem(P, Size);
{$else}
Result := DebugReallocMem(P, Size);
{$endif}
{$else}
Result := System.SysReallocMem(P, Size);
{$endif}
end;
//Export: @Borlndmm@SysFreeMem$qqrpv
//Symbol: @Borlndmm@SysFreeMem$qqrpv
function SysFreeMem(P: Pointer): Integer;
begin
{$ifndef UseRTLMM}
{$ifndef FullDebugMode}
Result := FastFreeMem(P);
{$else}
Result := DebugFreeMem(P);
{$endif}
{$else}
Result := System.SysFreeMem(P);
{$endif}
end;
//Export: @Borlndmm@SysGetMem$qqri
//Symbol: @Borlndmm@SysGetMem$qqri
function SysGetMem(Size: Integer): Pointer;
begin
{$ifndef UseRTLMM}
{$ifndef FullDebugMode}
Result := FastGetMem(Size);
{$else}
Result := DebugGetMem(Size);
{$endif}
{$else}
Result := System.SysGetMem(Size);
{$endif}
end;
//Export: @Borlndmm@SysAllocMem$qqri
//Symbol: @Borlndmm@SysAllocMem$qqrui
function SysAllocMem(Size: Cardinal): Pointer;
begin
{$ifndef UseRTLMM}
{$ifndef FullDebugMode}
Result := FastAllocMem(Size);
{$else}
Result := DebugAllocMem(Size);
{$endif}
{$else}
//{$ifdef VER180}
{$if RTLVersion >= 18}
Result := System.SysAllocMem(Size);
{$ifend}
{$if RTLVersion < 18}
Result := System.AllocMem(Size);
{$ifend}
{$endif}
end;
//Export: @Borlndmm@SysUnregisterExpectedMemoryLeak$qqrpi
//Symbol: @Borlndmm@UnregisterExpectedMemoryLeak$qqrpv
function UnregisterExpectedMemoryLeak(ALeakedPointer: Pointer): Boolean;
begin
{$ifndef UseRTLMM}
{$ifdef EnableMemoryLeakReporting}
Result := UnregisterExpectedMemoryLeak(ALeakedPointer);
{$else}
Result := False;
{$endif}
{$else}
//{$ifdef VER180}
{$if RTLVersion >= 18}
Result := System.SysUnregisterExpectedMemoryLeak(ALeakedPointer);
{$ifend}
{$if RTLVersion < 18}
Result := False;
{$ifend}
{$endif}
end;
//Export: @Borlndmm@SysRegisterExpectedMemoryLeak$qqrpi
//Symbol: @Borlndmm@RegisterExpectedMemoryLeak$qqrpv
function RegisterExpectedMemoryLeak(ALeakedPointer: Pointer): Boolean;
begin
{$ifndef UseRTLMM}
{$ifdef EnableMemoryLeakReporting}
Result := RegisterExpectedMemoryLeak(ALeakedPointer);
{$else}
Result := False;
{$endif}
{$else}
//{$ifdef VER180}
{$if RTLVersion >= 18}
Result := System.SysRegisterExpectedMemoryLeak(ALeakedPointer);
{$ifend}
{$if RTLVersion < 18}
Result := False;
{$ifend}
{$endif}
end;
initialization
IsMultiThread := True;
finalization
end.

View File

@@ -0,0 +1,31 @@
//---------------------------------------------------------------------------
#include <windows.h>
//---------------------------------------------------------------------------
// Important note about DLL memory management when your DLL uses the
// static version of the RunTime Library:
//
// If your DLL exports any functions that pass String objects (or structs/
// classes containing nested Strings) as parameter or function results,
// you will need to add the library MEMMGR.LIB to both the DLL project and
// any other projects that use the DLL. You will also need to use MEMMGR.LIB
// if any other projects which use the DLL will be performing new or delete
// operations on any non-TObject-derived classes which are exported from the
// DLL. Adding MEMMGR.LIB to your project will change the DLL and its calling
// EXE's to use the BORLNDMM.DLL as their memory manager. In these cases,
// the file BORLNDMM.DLL should be deployed along with your DLL.
//
// To avoid using BORLNDMM.DLL, pass string information using "char *" or
// ShortString parameters.
//
// If your DLL uses the dynamic version of the RTL, you do not need to
// explicitly add MEMMGR.LIB as this will be done implicitly for you
//---------------------------------------------------------------------------
#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
return 1;
}
//---------------------------------------------------------------------------

View File

@@ -0,0 +1,29 @@
LIBRARY BORLNDMM.DLL
EXPORTS
GetAllocMemCount = @Borlndmm_@GetAllocMemCount$qqrv ;To make it the 2nd export, ___CPPdebugHook always the 1st export
GetAllocMemSize = @Borlndmm_@GetAllocMemSize$qqrv
GetHeapStatus = @Borlndmm_@GetHeapStatus$qqrv
DumpBlocks = @Borlndmm_@DumpBlocks$qqrv
ReallocMemory = @Borlndmm_@ReallocMemory$qpvi
FreeMemory = @Borlndmm_@FreeMemory$qpv
GetMemory = @Borlndmm_@GetMemory$qi
;@Borlndmm@SysUnregisterExpectedMemoryLeak$qqrpi = @Borlndmm_@UnregisterExpectedMemoryLeak$qqrpv
;@Borlndmm@SysRegisterExpectedMemoryLeak$qqrpi = @Borlndmm_@RegisterExpectedMemoryLeak$qqrpv
;@Borlndmm@SysAllocMem$qqri = @Borlndmm_@SysAllocMem$qqrui
@Borlndmm@SysReallocMem$qqrpvi = @Borlndmm_@SysReallocMem$qqrpvi
@Borlndmm@SysFreeMem$qqrpv = @Borlndmm_@SysFreeMem$qqrpv
@Borlndmm@SysGetMem$qqri = @Borlndmm_@SysGetMem$qqri
@Borlndmm@HeapRelease$qqrv = @Borlndmm_@HeapRelease$qqrv
@Borlndmm@HeapAddRef$qqrv = @Borlndmm_@HeapAddRef$qqrv
;SetMMLogFileName = @Fastmm4@SetMMLogFileName$qqrpc
;GetCurrentAllocationGroup = @Fastmm4@GetCurrentAllocationGroup$qqrv
;PushAllocationGroup = @Fastmm4@PushAllocationGroup$qqrui
;PopAllocationGroup = @Fastmm4@PopAllocationGroup$qqrv
;LogAllocatedBlocksToFile = @Fastmm4@LogAllocatedBlocksToFile$qqruiui

View File

@@ -0,0 +1,263 @@
<?xml version="1.0" encoding="utf-8"?>
<BorlandProject>
<PersonalityInfo>
<Option>
<Option Name="Personality">CPlusPlusBuilder.Personality</Option>
<Option Name="ProjectType">CppDynamicLibrary</Option>
<Option Name="Version">1.0</Option>
<Option Name="GUID">{8CAC3371-4081-47E8-B126-3D87B7662AF9}</Option>
</Option>
</PersonalityInfo>
<CPlusPlusBuilder.Personality>
<Source>
<Source Name="MainSource">BorlndMM.bpf</Source>
</Source>
<BCBPROJECT>
<project version="10.0">
<property category="build.config" name="active" value="0"/>
<property category="build.config" name="count" value="1"/>
<property category="build.config" name="excludedefaultforzero" value="0"/>
<property category="build.config.0" name="builddir" value="Debug"/>
<property category="build.config.0" name="key" value="Debug_Build"/>
<property category="build.config.0" name="name" value="Debug Build"/>
<property category="build.config.0" name="settings.win32b" value="default"/>
<property category="build.config.0" name="type" value="Toolset"/>
<property category="build.config.0" name="win32.win32b.builddir" value="Debug_Build"/>
<property category="build.config.1" name="key" value="Release_Build"/>
<property category="build.config.1" name="name" value="Release Build"/>
<property category="build.config.1" name="settings.win32b" value="default"/>
<property category="build.config.1" name="type" value="Toolset"/>
<property category="build.config.1" name="win32.win32b.builddir" value="Release_Build"/>
<property category="build.node" name="libraries" value="rtl.lib"/>
<property category="build.node" name="name" value="BorlndMM.dll"/>
<property category="build.node" name="packages" value="rtl;vclx;vcl;dbrtl;vcldb;vclactnband;xmlrtl;bcbsmp;dsnap;bdertl;vcldbx"/>
<property category="build.node" name="sparelibs" value="rtl.lib"/>
<property category="build.node" name="use_packages" value="0"/>
<property category="build.platform" name="active" value="win32"/>
<property category="build.platform" name="win32.Debug_Build.toolset" value="win32b"/>
<property category="build.platform" name="win32.Release_Build.toolset" value="win32b"/>
<property category="build.platform" name="win32.default" value="win32b"/>
<property category="build.platform" name="win32.enabled" value="1"/>
<property category="build.platform" name="win32.win32b.enabled" value="1"/>
<property category="win32.*.win32b.dcc32" name="param.filenames.merge" value="1"/>
<property category="win32.*.win32b.tasm32" name="param.listfile.merge" value="1"/>
<property category="win32.*.win32b.tasm32" name="param.objfile.merge" value="1"/>
<property category="win32.*.win32b.tasm32" name="param.xreffile.merge" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.D.arg.1" value="_DEBUG"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.D.arg.merge" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.D.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.Od.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.k.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.r.enabled" value="0"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.v.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.vi.enabled" value="0"/>
<property category="win32.Debug_Build.win32b.bcc32" name="option.y.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.dcc32" name="option.$D.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.dcc32" name="option.$O.enabled" value="0"/>
<property category="win32.Debug_Build.win32b.dcc32" name="option.D.arg.1" value="DEBUG"/>
<property category="win32.Debug_Build.win32b.dcc32" name="option.D.arg.merge" value="1"/>
<property category="win32.Debug_Build.win32b.dcc32" name="option.D.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.dcc32" name="param.filenames.merge" value="1"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.L.arg.1" value="$(BDS)\lib\debug"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.L.arg.merge" value="1"/>
<property category="win32.Debug_Build.win32b.ilink32" name="option.L.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.tasm32" name="option.z.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.tasm32" name="option.zd.enabled" value="0"/>
<property category="win32.Debug_Build.win32b.tasm32" name="option.zi.enabled" value="1"/>
<property category="win32.Debug_Build.win32b.tasm32" name="param.listfile.merge" value="1"/>
<property category="win32.Debug_Build.win32b.tasm32" name="param.objfile.merge" value="1"/>
<property category="win32.Debug_Build.win32b.tasm32" name="param.xreffile.merge" value="1"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.D.arg.1" value="NDEBUG"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.D.arg.merge" value="1"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.D.enabled" value="1"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.O2.enabled" value="1"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.k.enabled" value="0"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.r.enabled" value="1"/>
<property category="win32.Release_Build.win32b.bcc32" name="option.vi.enabled" value="1"/>
<property category="win32.Release_Build.win32b.dcc32" name="option.$D.enabled" value="0"/>
<property category="win32.Release_Build.win32b.dcc32" name="option.V.enabled" value="0"/>
<property category="win32.Release_Build.win32b.dcc32" name="param.filenames.merge" value="1"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.L.arg.1" value="$(BDS)\lib\release"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.L.arg.merge" value="1"/>
<property category="win32.Release_Build.win32b.ilink32" name="option.L.enabled" value="1"/>
<property category="win32.Release_Build.win32b.tasm32" name="option.z.enabled" value="0"/>
<property category="win32.Release_Build.win32b.tasm32" name="option.zd.enabled" value="0"/>
<property category="win32.Release_Build.win32b.tasm32" name="option.zi.enabled" value="0"/>
<property category="win32.Release_Build.win32b.tasm32" name="option.zn.enabled" value="1"/>
<property category="win32.Release_Build.win32b.tasm32" name="param.listfile.merge" value="1"/>
<property category="win32.Release_Build.win32b.tasm32" name="param.objfile.merge" value="1"/>
<property category="win32.Release_Build.win32b.tasm32" name="param.xreffile.merge" value="1"/>
<optionset name="all_configurations">
<property category="node" name="displayname" value="All Configurations"/>
<property category="win32.*.win32b.bcc32" name="container.SelectedOptimizations.containerenabled" value="1"/>
<property category="win32.*.win32b.bcc32" name="container.SelectedWarnings.containerenabled" value="1"/>
<property category="win32.*.win32b.bcc32" name="option.4.enabled" value="0"/>
<property category="win32.*.win32b.bcc32" name="option.5.enabled" value="0"/>
<property category="win32.*.win32b.bcc32" name="option.6.enabled" value="0"/>
<property category="win32.*.win32b.bcc32" name="option.H=.arg.1" value="$(BDS)\lib\vcl100.csm"/>
<property category="win32.*.win32b.bcc32" name="option.H=.arg.merge" value="1"/>
<property category="win32.*.win32b.bcc32" name="option.H=.enabled" value="1"/>
<property category="win32.*.win32b.bcc32" name="option.Hc.enabled" value="1"/>
<property category="win32.*.win32b.bcc32" name="option.I.arg.1" value="BorlndMM"/>
<property category="win32.*.win32b.bcc32" name="option.I.arg.2" value="$(BDS)\include"/>
<property category="win32.*.win32b.bcc32" name="option.I.arg.3" value="$(BDS)\include\dinkumware"/>
<property category="win32.*.win32b.bcc32" name="option.I.arg.4" value="$(BDS)\include\vcl"/>
<property category="win32.*.win32b.bcc32" name="option.I.arg.merge" value="1"/>
<property category="win32.*.win32b.bcc32" name="option.I.enabled" value="1"/>
<property category="win32.*.win32b.bcc32" name="option.O1.enabled" value="0"/>
<property category="win32.*.win32b.bcc32" name="option.O2.enabled" value="0"/>
<property category="win32.*.win32b.bcc32" name="option.Od.enabled" value="0"/>
<property category="win32.*.win32b.bcc32" name="option.Ve.enabled" value="0"/>
<property category="win32.*.win32b.bcc32" name="option.b.enabled" value="0"/>
<property category="win32.*.win32b.bcc32" name="option.disablewarns.enabled" value="0"/>
<property category="win32.*.win32b.bcc32" name="option.sysdefines.arg.1" value="_RTLDLL"/>
<property category="win32.*.win32b.bcc32" name="option.sysdefines.arg.2" value="NO_STRICT"/>
<property category="win32.*.win32b.bcc32" name="option.sysdefines.arg.3" value="_NO_VCL"/>
<property category="win32.*.win32b.bcc32" name="option.sysdefines.arg.merge" value="1"/>
<property category="win32.*.win32b.bcc32" name="option.sysdefines.enabled" value="1"/>
<property category="win32.*.win32b.bcc32" name="option.tW.enabled" value="0"/>
<property category="win32.*.win32b.bcc32" name="option.tWC.enabled" value="0"/>
<property category="win32.*.win32b.bcc32" name="option.tWD.enabled" value="1"/>
<property category="win32.*.win32b.bcc32" name="option.tWM.enabled" value="1"/>
<property category="win32.*.win32b.bcc32" name="option.w.enabled" value="0"/>
<property category="win32.*.win32b.dcc32" name="option.$A1.enabled" value="0"/>
<property category="win32.*.win32b.dcc32" name="option.$A2.enabled" value="0"/>
<property category="win32.*.win32b.dcc32" name="option.$A4.enabled" value="0"/>
<property category="win32.*.win32b.dcc32" name="option.$W.enabled" value="0"/>
<property category="win32.*.win32b.dcc32" name="option.$Z2.enabled" value="0"/>
<property category="win32.*.win32b.dcc32" name="option.$Z4.enabled" value="0"/>
<property category="win32.*.win32b.dcc32" name="option.D.arg.1" value="BCB"/>
<property category="win32.*.win32b.dcc32" name="option.D.arg.merge" value="1"/>
<property category="win32.*.win32b.dcc32" name="option.D.enabled" value="1"/>
<property category="win32.*.win32b.dcc32" name="option.GD.enabled" value="0"/>
<property category="win32.*.win32b.dcc32" name="option.GP.enabled" value="0"/>
<property category="win32.*.win32b.dcc32" name="option.GS.enabled" value="0"/>
<property category="win32.*.win32b.dcc32" name="option.I.arg.1" value="BorlndMM"/>
<property category="win32.*.win32b.dcc32" name="option.I.arg.merge" value="1"/>
<property category="win32.*.win32b.dcc32" name="option.I.enabled" value="0"/>
<property category="win32.*.win32b.dcc32" name="option.J.enabled" value="0"/>
<property category="win32.*.win32b.dcc32" name="option.JP.enabled" value="0"/>
<property category="win32.*.win32b.dcc32" name="option.JPH.enabled" value="0"/>
<property category="win32.*.win32b.dcc32" name="option.JPHN.enabled" value="1"/>
<property category="win32.*.win32b.dcc32" name="option.JPHNE.enabled" value="0"/>
<property category="win32.*.win32b.dcc32" name="option.O.arg.1" value="BorlndMM"/>
<property category="win32.*.win32b.dcc32" name="option.O.arg.merge" value="1"/>
<property category="win32.*.win32b.dcc32" name="option.O.enabled" value="0"/>
<property category="win32.*.win32b.dcc32" name="option.R.arg.1" value="BorlndMM"/>
<property category="win32.*.win32b.dcc32" name="option.R.arg.merge" value="1"/>
<property category="win32.*.win32b.dcc32" name="option.R.enabled" value="0"/>
<property category="win32.*.win32b.dcc32" name="option.U.arg.1" value="BorlndMM"/>
<property category="win32.*.win32b.dcc32" name="option.U.arg.2" value=".."/>
<property category="win32.*.win32b.dcc32" name="option.U.arg.3" value="$(BDS)\lib"/>
<property category="win32.*.win32b.dcc32" name="option.U.arg.4" value="$(BDS)\lib\obj"/>
<property category="win32.*.win32b.dcc32" name="option.U.arg.merge" value="1"/>
<property category="win32.*.win32b.dcc32" name="option.U.enabled" value="1"/>
<property category="win32.*.win32b.dcc32" name="param.filenames.merge" value="1"/>
<property category="win32.*.win32b.idl2cpp" name="option.I.arg.1" value="BorlndMM"/>
<property category="win32.*.win32b.idl2cpp" name="option.I.arg.merge" value="1"/>
<property category="win32.*.win32b.idl2cpp" name="option.I.enabled" value="1"/>
<property category="win32.*.win32b.ilink32" name="container.SelectedWarnings.containerenabled" value="1"/>
<property category="win32.*.win32b.ilink32" name="option.-w-.enabled" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.Gi.enabled" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.Gpd.enabled" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.Gpr.enabled" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.I.arg.merge" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.I.enabled" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.L.arg.1" value="BorlndMM"/>
<property category="win32.*.win32b.ilink32" name="option.L.arg.2" value="$(BDS)\lib"/>
<property category="win32.*.win32b.ilink32" name="option.L.arg.3" value="$(BDS)\lib\obj"/>
<property category="win32.*.win32b.ilink32" name="option.L.arg.4" value="$(BDS)\lib\psdk"/>
<property category="win32.*.win32b.ilink32" name="option.L.arg.merge" value="1"/>
<property category="win32.*.win32b.ilink32" name="option.L.enabled" value="1"/>
<property category="win32.*.win32b.ilink32" name="option.Tpd.enabled" value="1"/>
<property category="win32.*.win32b.ilink32" name="option.Tpe.enabled" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.Tpp.enabled" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.aa.enabled" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.ap.enabled" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.b:xxxx.arg" value="0x211D0000"/>
<property category="win32.*.win32b.ilink32" name="option.b:xxxx.arg.merge" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.b:xxxx.enabled" value="1"/>
<property category="win32.*.win32b.ilink32" name="option.dynamicrtl.enabled" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.j.arg.1" value="BorlndMM"/>
<property category="win32.*.win32b.ilink32" name="option.j.arg.merge" value="1"/>
<property category="win32.*.win32b.ilink32" name="option.j.enabled" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.m.enabled" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.map_segments.enabled" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.outputdir.arg.merge" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.outputdir.enabled" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.s.enabled" value="0"/>
<property category="win32.*.win32b.ilink32" name="option.w.enabled" value="0"/>
<property category="win32.*.win32b.ilink32" name="param.libfiles.1" value="import32.lib"/>
<property category="win32.*.win32b.ilink32" name="param.libfiles.2" value="cw32mti.lib"/>
<property category="win32.*.win32b.ilink32" name="param.libfiles.merge" value="1"/>
<property category="win32.*.win32b.ilink32" name="param.objfiles.1" value="c0d32.obj"/>
<property category="win32.*.win32b.ilink32" name="param.objfiles.2" value="$(PACKAGES)"/>
<property category="win32.*.win32b.ilink32" name="param.objfiles.merge" value="1"/>
</optionset>
</project>
<FILELIST>
<FILE FILENAME="BorlndMM.bpf" CONTAINERID="BPF" LOCALCOMMAND="" UNITNAME="BorlndMM" FORMNAME="" DESIGNCLASS=""/>
<FILE FILENAME="DLLEntry.cpp" CONTAINERID="CCompiler" LOCALCOMMAND="" UNITNAME="DLLEntry" FORMNAME="" DESIGNCLASS=""/>
<FILE FILENAME="FastMM4BCB.cpp" CONTAINERID="CCompiler" LOCALCOMMAND="" UNITNAME="FastMM4BCB" FORMNAME="" DESIGNCLASS=""/>
<FILE FILENAME="FastMM4.pas" CONTAINERID="PascalCompiler" LOCALCOMMAND="" UNITNAME="FastMM4" FORMNAME="" DESIGNCLASS=""/>
<FILE FILENAME="BorlndMM.pas" CONTAINERID="PascalCompiler" LOCALCOMMAND="" UNITNAME="PasImpl" FORMNAME="" DESIGNCLASS=""/>
<FILE FILENAME="Export.def" CONTAINERID="DefTool" LOCALCOMMAND="" UNITNAME="Export" FORMNAME="" DESIGNCLASS=""/>
</FILELIST>
<IDEOPTIONS>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">2052</VersionInfo>
<VersionInfo Name="CodePage">936</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"></VersionInfoKeys>
<VersionInfoKeys Name="FileDescription"></VersionInfoKeys>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"></VersionInfoKeys>
<VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys>
<VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
<VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys>
<VersionInfoKeys Name="ProductName"></VersionInfoKeys>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
</VersionInfoKeys>
<Debugging>
<Debugging Name="DebugSourceDirs"></Debugging>
</Debugging>
<Parameters>
<Parameters Name="RunParams"></Parameters>
<Parameters Name="Launcher"></Parameters>
<Parameters Name="UseLauncher">False</Parameters>
<Parameters Name="DebugCWD"></Parameters>
<Parameters Name="HostApplication"></Parameters>
<Parameters Name="RemoteHost"></Parameters>
<Parameters Name="RemotePath"></Parameters>
<Parameters Name="RemoteParams"></Parameters>
<Parameters Name="RemoteLauncher"></Parameters>
<Parameters Name="UseRemoteLauncher">False</Parameters>
<Parameters Name="RemoteCWD"></Parameters>
<Parameters Name="RemoteDebug">False</Parameters>
<Parameters Name="Debug Symbols Search Path"></Parameters>
<Parameters Name="LoadAllSymbols">True</Parameters>
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
</Parameters>
<Linker>
<Linker Name="LibPrefix"></Linker>
<Linker Name="LibSuffix"></Linker>
<Linker Name="LibVersion"></Linker>
</Linker>
</IDEOPTIONS>
</BCBPROJECT>
<buildevents/>
</CPlusPlusBuilder.Personality>
</BorlandProject>

View File

@@ -0,0 +1,5 @@
This file is used by the project manager only and should be treated like the project file
To add a file to this project use the Project menu 'Add to Project'
DllEntryPoint

View File

@@ -0,0 +1,248 @@
unit BorlndMM;
interface
{--------------------Start of options block-------------------------}
{Set the following option to use the RTL MM instead of FastMM. Setting this
option makes this replacement DLL almost identical to the default
borlndmm.dll, unless the "FullDebugMode" option is also set.}
{.$define UseRTLMM}
{--------------------End of options block-------------------------}
{$Include FastMM4Options.inc}
{Cannot use the RTL MM with full debug mode}
{$ifdef FullDebugMode}
{$undef UseRTLMM}
{$endif}
function GetAllocMemCount: integer;
function GetAllocMemSize: integer;
procedure DumpBlocks;
function HeapRelease: Integer;
function HeapAddRef: Integer;
function SysReallocMem(P: Pointer; Size: Integer): Pointer;
function SysFreeMem(P: Pointer): Integer;
function SysGetMem(Size: Integer): Pointer;
function SysAllocMem(Size: Cardinal): Pointer;
function ReallocMemory(P: Pointer; Size: Integer): Pointer; cdecl;
function FreeMemory(P: Pointer): Integer; cdecl;
function GetMemory(Size: Integer): Pointer; cdecl;
function GetHeapStatus: THeapStatus; deprecated; platform;
function RegisterExpectedMemoryLeak(ALeakedPointer: Pointer): Boolean;
function UnregisterExpectedMemoryLeak(ALeakedPointer: Pointer): Boolean;
implementation
{$ifndef UseRTLMM}
uses
FastMM4;
{$endif}
{$OPTIMIZATION ON}
{$STACKFRAMES OFF}
{$RANGECHECKS OFF}
{$OVERFLOWCHECKS OFF}
{$ifdef NoDebugInfo}
{$DEBUGINFO OFF}
{$endif}
//Export: GetAllocMemCount
//Symbol: @Borlndmm@GetAllocMemCount$qqrv
function GetAllocMemCount: integer;
begin
{Return stats for the RTL MM only}
{$ifdef UseRTLMM}
Result := System.AllocMemCount;
{$else}
Result := 0;
{$endif}
end;
//Export: GetAllocMemSize
//Symbol: @Borlndmm@GetAllocMemSize$qqrv
function GetAllocMemSize: integer;
begin
{Return stats for the RTL MM only}
{$ifdef UseRTLMM}
Result := System.AllocMemSize;
{$else}
Result := 0;
{$endif}
end;
//Export: DumpBlocks
//Symbol: @Borlndmm@DumpBlocks$qqrv
procedure DumpBlocks;
begin
{Do nothing}
end;
//Export: @Borlndmm@HeapRelease$qqrv
//Symbol: @Borlndmm@HeapRelease$qqrv
function HeapRelease: Integer;
begin
{Do nothing}
Result := 2;
end;
//Export: @Borlndmm@HeapAddRef$qqrv
//Symbol: @Borlndmm@HeapAddRef$qqrv
function HeapAddRef: Integer;
begin
{Do nothing}
Result := 2;
end;
//Export: GetHeapStatus
//Symbol: @Borlndmm@GetHeapStatus$qqrv
function GetHeapStatus: THeapStatus; deprecated; platform;
begin
{$ifndef UseRTLMM}
Result := FastGetHeapStatus;
{$else}
Result := System.GetHeapStatus;
{$endif}
end;
//Export: ReallocMemory
//Symbol: @Borlndmm@ReallocMemory$qpvi
function ReallocMemory(P: Pointer; Size: Integer): Pointer; cdecl;
begin
Result := System.ReallocMemory(P, Size);
end;
//Export: FreeMemory
//Symbol: @Borlndmm@FreeMemory$qpv
function FreeMemory(P: Pointer): Integer; cdecl;
begin
Result := System.FreeMemory(P);
end;
//Export: GetMemory
//Symbol: @Borlndmm@GetMemory$qi
function GetMemory(Size: Integer): Pointer; cdecl;
begin
Result := System.GetMemory(Size);
end;
//Export: @Borlndmm@SysReallocMem$qqrpvi
//Symbol: @Borlndmm@SysReallocMem$qqrpvi
function SysReallocMem(P: Pointer; Size: Integer): Pointer;
begin
{$ifndef UseRTLMM}
{$ifndef FullDebugMode}
Result := FastReallocMem(P, Size);
{$else}
Result := DebugReallocMem(P, Size);
{$endif}
{$else}
Result := System.SysReallocMem(P, Size);
{$endif}
end;
//Export: @Borlndmm@SysFreeMem$qqrpv
//Symbol: @Borlndmm@SysFreeMem$qqrpv
function SysFreeMem(P: Pointer): Integer;
begin
{$ifndef UseRTLMM}
{$ifndef FullDebugMode}
Result := FastFreeMem(P);
{$else}
Result := DebugFreeMem(P);
{$endif}
{$else}
Result := System.SysFreeMem(P);
{$endif}
end;
//Export: @Borlndmm@SysGetMem$qqri
//Symbol: @Borlndmm@SysGetMem$qqri
function SysGetMem(Size: Integer): Pointer;
begin
{$ifndef UseRTLMM}
{$ifndef FullDebugMode}
Result := FastGetMem(Size);
{$else}
Result := DebugGetMem(Size);
{$endif}
{$else}
Result := System.SysGetMem(Size);
{$endif}
end;
//Export: @Borlndmm@SysAllocMem$qqri
//Symbol: @Borlndmm@SysAllocMem$qqrui
function SysAllocMem(Size: Cardinal): Pointer;
begin
{$ifndef UseRTLMM}
{$ifndef FullDebugMode}
Result := FastAllocMem(Size);
{$else}
Result := DebugAllocMem(Size);
{$endif}
{$else}
//{$ifdef VER180}
{$if RTLVersion >= 18}
Result := System.SysAllocMem(Size);
{$ifend}
{$if RTLVersion < 18}
Result := System.AllocMem(Size);
{$ifend}
{$endif}
end;
//Export: @Borlndmm@SysUnregisterExpectedMemoryLeak$qqrpi
//Symbol: @Borlndmm@UnregisterExpectedMemoryLeak$qqrpv
function UnregisterExpectedMemoryLeak(ALeakedPointer: Pointer): Boolean;
begin
{$ifndef UseRTLMM}
{$ifdef EnableMemoryLeakReporting}
Result := UnregisterExpectedMemoryLeak(ALeakedPointer);
{$else}
Result := False;
{$endif}
{$else}
//{$ifdef VER180}
{$if RTLVersion >= 18}
Result := System.SysUnregisterExpectedMemoryLeak(ALeakedPointer);
{$ifend}
{$if RTLVersion < 18}
Result := False;
{$ifend}
{$endif}
end;
//Export: @Borlndmm@SysRegisterExpectedMemoryLeak$qqrpi
//Symbol: @Borlndmm@RegisterExpectedMemoryLeak$qqrpv
function RegisterExpectedMemoryLeak(ALeakedPointer: Pointer): Boolean;
begin
{$ifndef UseRTLMM}
{$ifdef EnableMemoryLeakReporting}
Result := RegisterExpectedMemoryLeak(ALeakedPointer);
{$else}
Result := False;
{$endif}
{$else}
//{$ifdef VER180}
{$if RTLVersion >= 18}
Result := System.SysRegisterExpectedMemoryLeak(ALeakedPointer);
{$ifend}
{$if RTLVersion < 18}
Result := False;
{$ifend}
{$endif}
end;
initialization
IsMultiThread := True;
finalization
end.

View File

@@ -0,0 +1,30 @@
//---------------------------------------------------------------------------
#include <windows.h>
//---------------------------------------------------------------------------
// Important note about DLL memory management when your DLL uses the
// static version of the RunTime Library:
//
// If your DLL exports any functions that pass String objects (or structs/
// classes containing nested Strings) as parameter or function results,
// you will need to add the library MEMMGR.LIB to both the DLL project and
// any other projects that use the DLL. You will also need to use MEMMGR.LIB
// if any other projects which use the DLL will be performing new or delete
// operations on any non-TObject-derived classes which are exported from the
// DLL. Adding MEMMGR.LIB to your project will change the DLL and its calling
// EXE's to use the BORLNDMM.DLL as their memory manager. In these cases,
// the file BORLNDMM.DLL should be deployed along with your DLL.
//
// To avoid using BORLNDMM.DLL, pass string information using "char *" or
// ShortString parameters.
//
// If your DLL uses the dynamic version of the RTL, you do not need to
// explicitly add MEMMGR.LIB as this will be done implicitly for you
//---------------------------------------------------------------------------
#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
return 1;
}
//---------------------------------------------------------------------------

View File

@@ -0,0 +1,29 @@
LIBRARY BORLNDMM.DLL
EXPORTS
GetAllocMemCount = @Borlndmm@GetAllocMemCount$qqrv ;To make it the 2nd export, ___CPPdebugHook always the 1st export
GetAllocMemSize = @Borlndmm@GetAllocMemSize$qqrv
GetHeapStatus = @Borlndmm@GetHeapStatus$qqrv
DumpBlocks = @Borlndmm@DumpBlocks$qqrv
ReallocMemory = @Borlndmm@ReallocMemory$qpvi
FreeMemory = @Borlndmm@FreeMemory$qpv
GetMemory = @Borlndmm@GetMemory$qi
@Borlndmm@SysUnregisterExpectedMemoryLeak$qqrpi = @Borlndmm@UnregisterExpectedMemoryLeak$qqrpv
@Borlndmm@SysRegisterExpectedMemoryLeak$qqrpi = @Borlndmm@RegisterExpectedMemoryLeak$qqrpv
@Borlndmm@SysAllocMem$qqri = @Borlndmm@SysAllocMem$qqrui
@Borlndmm@SysReallocMem$qqrpvi
@Borlndmm@SysFreeMem$qqrpv
@Borlndmm@SysGetMem$qqri
@Borlndmm@HeapRelease$qqrv
@Borlndmm@HeapAddRef$qqrv
SetMMLogFileName = @Fastmm4@SetMMLogFileName$qqrpc
GetCurrentAllocationGroup = @Fastmm4@GetCurrentAllocationGroup$qqrv
PushAllocationGroup = @Fastmm4@PushAllocationGroup$qqrui
PopAllocationGroup = @Fastmm4@PopAllocationGroup$qqrv
LogAllocatedBlocksToFile = @Fastmm4@LogAllocatedBlocksToFile$qqruiui

View File

@@ -0,0 +1 @@
LoadDebugDLLDynamically must be defined.

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,248 @@
unit BorlndMM;
interface
{--------------------Start of options block-------------------------}
{Set the following option to use the RTL MM instead of FastMM. Setting this
option makes this replacement DLL almost identical to the default
borlndmm.dll, unless the "FullDebugMode" option is also set.}
{.$define UseRTLMM}
{--------------------End of options block-------------------------}
{$Include FastMM4Options.inc}
{Cannot use the RTL MM with full debug mode}
{$ifdef FullDebugMode}
{$undef UseRTLMM}
{$endif}
function GetAllocMemCount: integer;
function GetAllocMemSize: integer;
procedure DumpBlocks;
function HeapRelease: Integer;
function HeapAddRef: Integer;
function SysReallocMem(P: Pointer; Size: Integer): Pointer;
function SysFreeMem(P: Pointer): Integer;
function SysGetMem(Size: Integer): Pointer;
function SysAllocMem(Size: Cardinal): Pointer;
function ReallocMemory(P: Pointer; Size: Integer): Pointer; cdecl;
function FreeMemory(P: Pointer): Integer; cdecl;
function GetMemory(Size: Integer): Pointer; cdecl;
function GetHeapStatus: THeapStatus; deprecated; platform;
function RegisterExpectedMemoryLeak(ALeakedPointer: Pointer): Boolean;
function UnregisterExpectedMemoryLeak(ALeakedPointer: Pointer): Boolean;
implementation
{$ifndef UseRTLMM}
uses
FastMM4;
{$endif}
{$OPTIMIZATION ON}
{$STACKFRAMES OFF}
{$RANGECHECKS OFF}
{$OVERFLOWCHECKS OFF}
{$ifdef NoDebugInfo}
{$DEBUGINFO OFF}
{$endif}
//Export: GetAllocMemCount
//Symbol: @Borlndmm@GetAllocMemCount$qqrv
function GetAllocMemCount: integer;
begin
{Return stats for the RTL MM only}
{$ifdef UseRTLMM}
Result := System.AllocMemCount;
{$else}
Result := 0;
{$endif}
end;
//Export: GetAllocMemSize
//Symbol: @Borlndmm@GetAllocMemSize$qqrv
function GetAllocMemSize: integer;
begin
{Return stats for the RTL MM only}
{$ifdef UseRTLMM}
Result := System.AllocMemSize;
{$else}
Result := 0;
{$endif}
end;
//Export: DumpBlocks
//Symbol: @Borlndmm@DumpBlocks$qqrv
procedure DumpBlocks;
begin
{Do nothing}
end;
//Export: @Borlndmm@HeapRelease$qqrv
//Symbol: @Borlndmm@HeapRelease$qqrv
function HeapRelease: Integer;
begin
{Do nothing}
Result := 2;
end;
//Export: @Borlndmm@HeapAddRef$qqrv
//Symbol: @Borlndmm@HeapAddRef$qqrv
function HeapAddRef: Integer;
begin
{Do nothing}
Result := 2;
end;
//Export: GetHeapStatus
//Symbol: @Borlndmm@GetHeapStatus$qqrv
function GetHeapStatus: THeapStatus; deprecated; platform;
begin
{$ifndef UseRTLMM}
Result := FastGetHeapStatus;
{$else}
Result := System.GetHeapStatus;
{$endif}
end;
//Export: ReallocMemory
//Symbol: @Borlndmm@ReallocMemory$qpvi
function ReallocMemory(P: Pointer; Size: Integer): Pointer; cdecl;
begin
Result := System.ReallocMemory(P, Size);
end;
//Export: FreeMemory
//Symbol: @Borlndmm@FreeMemory$qpv
function FreeMemory(P: Pointer): Integer; cdecl;
begin
Result := System.FreeMemory(P);
end;
//Export: GetMemory
//Symbol: @Borlndmm@GetMemory$qi
function GetMemory(Size: Integer): Pointer; cdecl;
begin
Result := System.GetMemory(Size);
end;
//Export: @Borlndmm@SysReallocMem$qqrpvi
//Symbol: @Borlndmm@SysReallocMem$qqrpvi
function SysReallocMem(P: Pointer; Size: Integer): Pointer;
begin
{$ifndef UseRTLMM}
{$ifndef FullDebugMode}
Result := FastReallocMem(P, Size);
{$else}
Result := DebugReallocMem(P, Size);
{$endif}
{$else}
Result := System.SysReallocMem(P, Size);
{$endif}
end;
//Export: @Borlndmm@SysFreeMem$qqrpv
//Symbol: @Borlndmm@SysFreeMem$qqrpv
function SysFreeMem(P: Pointer): Integer;
begin
{$ifndef UseRTLMM}
{$ifndef FullDebugMode}
Result := FastFreeMem(P);
{$else}
Result := DebugFreeMem(P);
{$endif}
{$else}
Result := System.SysFreeMem(P);
{$endif}
end;
//Export: @Borlndmm@SysGetMem$qqri
//Symbol: @Borlndmm@SysGetMem$qqri
function SysGetMem(Size: Integer): Pointer;
begin
{$ifndef UseRTLMM}
{$ifndef FullDebugMode}
Result := FastGetMem(Size);
{$else}
Result := DebugGetMem(Size);
{$endif}
{$else}
Result := System.SysGetMem(Size);
{$endif}
end;
//Export: @Borlndmm@SysAllocMem$qqri
//Symbol: @Borlndmm@SysAllocMem$qqrui
function SysAllocMem(Size: Cardinal): Pointer;
begin
{$ifndef UseRTLMM}
{$ifndef FullDebugMode}
Result := FastAllocMem(Size);
{$else}
Result := DebugAllocMem(Size);
{$endif}
{$else}
//{$ifdef VER180}
{$if RTLVersion >= 18}
Result := System.SysAllocMem(Size);
{$ifend}
{$if RTLVersion < 18}
Result := System.AllocMem(Size);
{$ifend}
{$endif}
end;
//Export: @Borlndmm@SysUnregisterExpectedMemoryLeak$qqrpi
//Symbol: @Borlndmm@UnregisterExpectedMemoryLeak$qqrpv
function UnregisterExpectedMemoryLeak(ALeakedPointer: Pointer): Boolean;
begin
{$ifndef UseRTLMM}
{$ifdef EnableMemoryLeakReporting}
Result := UnregisterExpectedMemoryLeak(ALeakedPointer);
{$else}
Result := False;
{$endif}
{$else}
//{$ifdef VER180}
{$if RTLVersion >= 18}
Result := System.SysUnregisterExpectedMemoryLeak(ALeakedPointer);
{$ifend}
{$if RTLVersion < 18}
Result := False;
{$ifend}
{$endif}
end;
//Export: @Borlndmm@SysRegisterExpectedMemoryLeak$qqrpi
//Symbol: @Borlndmm@RegisterExpectedMemoryLeak$qqrpv
function RegisterExpectedMemoryLeak(ALeakedPointer: Pointer): Boolean;
begin
{$ifndef UseRTLMM}
{$ifdef EnableMemoryLeakReporting}
Result := RegisterExpectedMemoryLeak(ALeakedPointer);
{$else}
Result := False;
{$endif}
{$else}
//{$ifdef VER180}
{$if RTLVersion >= 18}
Result := System.SysRegisterExpectedMemoryLeak(ALeakedPointer);
{$ifend}
{$if RTLVersion < 18}
Result := False;
{$ifend}
{$endif}
end;
initialization
IsMultiThread := True;
finalization
end.

View File

@@ -0,0 +1,30 @@
//---------------------------------------------------------------------------
#include <windows.h>
//---------------------------------------------------------------------------
// Important note about DLL memory management when your DLL uses the
// static version of the RunTime Library:
//
// If your DLL exports any functions that pass String objects (or structs/
// classes containing nested Strings) as parameter or function results,
// you will need to add the library MEMMGR.LIB to both the DLL project and
// any other projects that use the DLL. You will also need to use MEMMGR.LIB
// if any other projects which use the DLL will be performing new or delete
// operations on any non-TObject-derived classes which are exported from the
// DLL. Adding MEMMGR.LIB to your project will change the DLL and its calling
// EXE's to use the BORLNDMM.DLL as their memory manager. In these cases,
// the file BORLNDMM.DLL should be deployed along with your DLL.
//
// To avoid using BORLNDMM.DLL, pass string information using "char *" or
// ShortString parameters.
//
// If your DLL uses the dynamic version of the RTL, you do not need to
// explicitly add MEMMGR.LIB as this will be done implicitly for you
//---------------------------------------------------------------------------
#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
return 1;
}
//---------------------------------------------------------------------------

View File

@@ -0,0 +1,29 @@
LIBRARY BORLNDMM.DLL
EXPORTS
GetAllocMemCount = @Borlndmm@GetAllocMemCount$qqrv ;To make it the 2nd export, ___CPPdebugHook always the 1st export
GetAllocMemSize = @Borlndmm@GetAllocMemSize$qqrv
GetHeapStatus = @Borlndmm@GetHeapStatus$qqrv
DumpBlocks = @Borlndmm@DumpBlocks$qqrv
ReallocMemory = @Borlndmm@ReallocMemory$qpvi
FreeMemory = @Borlndmm@FreeMemory$qpv
GetMemory = @Borlndmm@GetMemory$qi
@Borlndmm@SysUnregisterExpectedMemoryLeak$qqrpi = @Borlndmm@UnregisterExpectedMemoryLeak$qqrpv
@Borlndmm@SysRegisterExpectedMemoryLeak$qqrpi = @Borlndmm@RegisterExpectedMemoryLeak$qqrpv
@Borlndmm@SysAllocMem$qqri = @Borlndmm@SysAllocMem$qqrui
@Borlndmm@SysReallocMem$qqrpvi
@Borlndmm@SysFreeMem$qqrpv
@Borlndmm@SysGetMem$qqri
@Borlndmm@HeapRelease$qqrv
@Borlndmm@HeapAddRef$qqrv
SetMMLogFileName = @Fastmm4@SetMMLogFileName$qqrpc
GetCurrentAllocationGroup = @Fastmm4@GetCurrentAllocationGroup$qqrv
PushAllocationGroup = @Fastmm4@PushAllocationGroup$qqrui
PopAllocationGroup = @Fastmm4@PopAllocationGroup$qqrv
LogAllocatedBlocksToFile = @Fastmm4@LogAllocatedBlocksToFile$qqruiui

View File

@@ -0,0 +1 @@
LoadDebugDLLDynamically must be defined.

View File

@@ -0,0 +1,182 @@
{
Fast Memory Manager: Replacement BorlndMM.DLL 1.05
Description:
A replacement borlndmm.dll using FastMM instead of the RTL MM. This DLL may be
used instead of the default DLL together with your own applications or the
Delphi IDE, making the benefits of FastMM available to them.
Usage:
1) Make sure the "NeverUninstall" conditional define is set in FastMM4.pas if
you intend to use the DLL with the Delphi IDE, otherwise it must be off.
2) Compile this DLL
3) Ship it with your existing applications that currently uses the borlndmm.dll
file that ships with Delphi for an improvement in speed.
4) Copy it over the current borlndmm.dll in the Delphi \Bin\ directory (after
renaming the old one) to speed up the IDE.*
Acknowledgements:
- Arthur Hoornweg for notifying me of the image base being incorrect for
borlndmm.dll.
- Cord Schneider for notifying me of the compilation error under Delphi 5.
Change log:
Version 1.00 (28 June 2005):
- Initial release.
Version 1.01 (30 June 2005):
- Added an unofficial patch for QC#14007 that prevented a replacement
borlndmm.dll from working together with Delphi 2005.
- Added the "NeverUninstall" option in FastMM4.pas to circumvent QC#14070,
which causes an A/V on shutdown of Delphi if FastMM uninstalls itself in the
finalization code of FastMM4.pas.
Version 1.02 (19 July 2005):
- Set the imagebase to $00D20000 to avoid relocation on load (and thus allow
sharing of the DLL between processes). (Thanks to Arthur Hoornweg.)
Version 1.03 (10 November 2005):
- Added exports for AllocMem and leak (un)registration
Version 1.04 (22 December 2005):
- Fixed the compilation error under Delphi 5. (Thanks to Cord Schneider.)
Version 1.05 (23 February 2006):
- Added some exports to allow access to the extended FullDebugMode
functionality in FastMM.
*For this replacement borlndmm.dll to work together with Delphi 2005, you will
need to apply the unofficial patch for QC#14007. To compile a replacement
borlndmm.dll for use with the Delphi IDE the "NeverUninstall" option must be
set (to circumvent QC#14070). For other uses the "NeverUninstall" option
should be disabled. For a list of unofficial patches for Delphi 2005 (and
where to get them), refer to the FastMM4_Readme.txt file.
}
{--------------------Start of options block-------------------------}
{Set the following option to use the RTL MM instead of FastMM. Setting this
option makes this replacement DLL almost identical to the default
borlndmm.dll, unless the "FullDebugMode" option is also set.}
{.$define UseRTLMM}
{--------------------End of options block-------------------------}
{$Include FastMM4Options.inc}
{Cannot use the RTL MM with full debug mode}
{$ifdef FullDebugMode}
{$undef UseRTLMM}
{$endif}
{Set the correct image base}
{$IMAGEBASE $00D20000}
library BorlndMM;
{$ifndef UseRTLMM}
uses
FastMM4 in 'FastMM4.pas',
FastMM4Messages in 'FastMM4Messages.pas';
{$endif}
{$R *.RES}
function GetAllocMemCount: integer;
begin
{Return stats for the RTL MM only}
{$ifdef UseRTLMM}
Result := System.AllocMemCount;
{$else}
Result := 0;
{$endif}
end;
function GetAllocMemSize: integer;
begin
{Return stats for the RTL MM only}
{$ifdef UseRTLMM}
Result := System.AllocMemSize;
{$else}
Result := 0;
{$endif}
end;
procedure DumpBlocks;
begin
{Do nothing}
end;
function HeapRelease: Integer;
begin
{Do nothing}
Result := 2;
end;
function HeapAddRef: Integer;
begin
{Do nothing}
Result := 2;
end;
function DummyRegisterAndUnregisterExpectedMemoryLeak(ALeakedPointer: Pointer): boolean;
begin
Result := False;
end;
exports
GetAllocMemSize name 'GetAllocMemSize',
GetAllocMemCount name 'GetAllocMemCount',
{$ifndef UseRTLMM}
FastGetHeapStatus name 'GetHeapStatus',
{$else}
System.GetHeapStatus name 'GetHeapStatus',
{$endif}
DumpBlocks name 'DumpBlocks',
System.ReallocMemory name 'ReallocMemory',
System.FreeMemory name 'FreeMemory',
System.GetMemory name 'GetMemory',
{$ifndef UseRTLMM}
{$ifndef FullDebugMode}
FastReallocMem name '@Borlndmm@SysReallocMem$qqrpvi',
FastFreeMem name '@Borlndmm@SysFreeMem$qqrpv',
FastGetMem name '@Borlndmm@SysGetMem$qqri',
FastAllocMem name '@Borlndmm@SysAllocMem$qqri',
{$else}
DebugReallocMem name '@Borlndmm@SysReallocMem$qqrpvi',
DebugFreeMem name '@Borlndmm@SysFreeMem$qqrpv',
DebugGetMem name '@Borlndmm@SysGetMem$qqri',
DebugAllocMem name '@Borlndmm@SysAllocMem$qqri',
{$endif}
{$ifdef EnableMemoryLeakReporting}
RegisterExpectedMemoryLeak(ALeakedPointer: Pointer) name '@Borlndmm@SysRegisterExpectedMemoryLeak$qqrpi',
UnregisterExpectedMemoryLeak(ALeakedPointer: Pointer) name '@Borlndmm@SysUnregisterExpectedMemoryLeak$qqrpi',
{$else}
DummyRegisterAndUnregisterExpectedMemoryLeak name '@Borlndmm@SysRegisterExpectedMemoryLeak$qqrpi',
DummyRegisterAndUnregisterExpectedMemoryLeak name '@Borlndmm@SysUnregisterExpectedMemoryLeak$qqrpi',
{$endif}
{$else}
System.SysReallocMem name '@Borlndmm@SysReallocMem$qqrpvi',
System.SysFreeMem name '@Borlndmm@SysFreeMem$qqrpv',
System.SysGetMem name '@Borlndmm@SysGetMem$qqri',
{$ifdef VER180};
System.SysAllocMem name '@Borlndmm@SysAllocMem$qqri',
System.SysRegisterExpectedMemoryLeak name '@Borlndmm@SysRegisterExpectedMemoryLeak$qqrpi',
System.SysUnregisterExpectedMemoryLeak name '@Borlndmm@SysUnregisterExpectedMemoryLeak$qqrpi',
{$else}
System.AllocMem name '@Borlndmm@SysAllocMem$qqri',
DummyRegisterAndUnregisterExpectedMemoryLeak name '@Borlndmm@SysRegisterExpectedMemoryLeak$qqrpi',
DummyRegisterAndUnregisterExpectedMemoryLeak name '@Borlndmm@SysUnregisterExpectedMemoryLeak$qqrpi',
{$endif}
{$endif}
{$ifdef FullDebugMode}
SetMMLogFileName,
GetCurrentAllocationGroup,
PushAllocationGroup,
PopAllocationGroup,
LogAllocatedBlocksToFile,
{$endif}
HeapRelease name '@Borlndmm@HeapRelease$qqrv',
HeapAddRef name '@Borlndmm@HeapAddRef$qqrv';
begin
IsMultiThread := True;
end.

View File

@@ -0,0 +1,74 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{b2046f52-e024-4415-9fc4-47822f5d8392}</ProjectGuid>
<MainSource>BorlndMM.dpr</MainSource>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
<DCC_DependencyCheckOutputName>BorlndMM.dll</DCC_DependencyCheckOutputName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Version>7.0</Version>
<DCC_DebugInformation>False</DCC_DebugInformation>
<DCC_LocalDebugSymbols>False</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_MapFile>3</DCC_MapFile>
<DCC_ImageBase>D20000</DCC_ImageBase>
<DCC_Define>borlndmmdll;debugdll;dllforide;RELEASE</DCC_Define>
<DCC_SYMBOL_PLATFORM>False</DCC_SYMBOL_PLATFORM>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<Version>7.0</Version>
<DCC_MapFile>3</DCC_MapFile>
<DCC_ImageBase>D20000</DCC_ImageBase>
<DCC_Define>borlndmmdll;debugdll;dllforide;DEBUG</DCC_Define>
<DCC_SYMBOL_PLATFORM>False</DCC_SYMBOL_PLATFORM>
</PropertyGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality</Borland.Personality>
<Borland.ProjectType>VCLApplication</Borland.ProjectType>
<BorlandProject>
<BorlandProject xmlns=""> <Delphi.Personality> <Parameters>
<Parameters Name="UseLauncher">False</Parameters>
<Parameters Name="LoadAllSymbols">True</Parameters>
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
</Parameters>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">True</VersionInfo>
<VersionInfo Name="AutoIncBuild">True</VersionInfo>
<VersionInfo Name="MajorVer">4</VersionInfo>
<VersionInfo Name="MinorVer">76</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">179</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">7177</VersionInfo>
<VersionInfo Name="CodePage">1252</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName">Pierre le Riche / Professional Software Development</VersionInfoKeys>
<VersionInfoKeys Name="FileDescription">Replacement Memory Manager for Delphi IDE and Applications</VersionInfoKeys>
<VersionInfoKeys Name="FileVersion">4.76.0.179</VersionInfoKeys>
<VersionInfoKeys Name="InternalName">Fast Memory Manager</VersionInfoKeys>
<VersionInfoKeys Name="LegalCopyright">License: MPL 1.1</VersionInfoKeys>
<VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
<VersionInfoKeys Name="OriginalFilename">BorlndMM.DLL</VersionInfoKeys>
<VersionInfoKeys Name="ProductName">FastMM</VersionInfoKeys>
<VersionInfoKeys Name="ProductVersion">4</VersionInfoKeys>
</VersionInfoKeys>
<Source>
<Source Name="MainSource">BorlndMM.dpr</Source>
</Source>
</Delphi.Personality> </BorlandProject></BorlandProject>
</ProjectExtensions>
<ItemGroup />
<ItemGroup>
<DelphiCompile Include="BorlndMM.dpr">
<MainSource>MainSource</MainSource>
</DelphiCompile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Borland.Delphi.Targets" />
</Project>

View File

@@ -0,0 +1,50 @@
{
Fast Memory Manager: FullDebugMode Borlndmm.dll support unit
If you use the replacement Borlndmm.dll compiled in FullDebugMode, and you need
access to some of the extended functionality that is not imported by
sharemem.pas, then you may use this unit to get access to it. Please note that
you will still need to add sharemem.pas as the first unit in the "uses"
section of the .dpr, and the FastMM_FullDebugMode.dll must be available on the
path. Also, the borlndmm.dll that you will be using *must* be compiled using
FullDebugMode.}
unit FastMMDebugSupport;
interface
{Specify the full path and name for the filename to be used for logging memory
errors, etc. If ALogFileName is nil or points to an empty string it will
revert to the default log file name.}
procedure SetMMLogFileName(ALogFileName: PAnsiChar = nil);
{Returns the current "allocation group". Whenever a GetMem request is serviced
in FullDebugMode, the current "allocation group" is stored in the block header.
This may help with debugging. Note that if a block is subsequently reallocated
that it keeps its original "allocation group" and "allocation number" (all
allocations are also numbered sequentially).}
function GetCurrentAllocationGroup: Cardinal;
{Allocation groups work in a stack like fashion. Group numbers are pushed onto
and popped off the stack. Note that the stack size is limited, so every push
should have a matching pop.}
procedure PushAllocationGroup(ANewCurrentAllocationGroup: Cardinal);
procedure PopAllocationGroup;
{Logs detail about currently allocated memory blocks for the specified range of
allocation groups. if ALastAllocationGroupToLog is less than
AFirstAllocationGroupToLog or it is zero, then all allocation groups are
logged. This routine also checks the memory pool for consistency at the same
time.}
procedure LogAllocatedBlocksToFile(AFirstAllocationGroupToLog, ALastAllocationGroupToLog: Cardinal);
implementation
const
borlndmm = 'borlndmm.dll';
procedure SetMMLogFileName; external borlndmm;
function GetCurrentAllocationGroup; external borlndmm;
procedure PushAllocationGroup; external borlndmm;
procedure PopAllocationGroup; external borlndmm;
procedure LogAllocatedBlocksToFile; external borlndmm;
end.