update to 0.7.0
This commit is contained in:
182
contrib/FastMM4-AVX/Replacement BorlndMM DLL/Delphi/BorlndMM.dpr
Normal file
182
contrib/FastMM4-AVX/Replacement BorlndMM DLL/Delphi/BorlndMM.dpr
Normal 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.
|
@@ -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>
|
@@ -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.
|
Reference in New Issue
Block a user