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