- Mastering Delphi Programming:A Complete Reference Guide
- Primo? Gabrijel?i?
- 291字
- 2021-06-24 12:33:39
ScaleMM
First such memory manager is ScaleMM. It is the work of André Mussche and can be downloaded from https://github.com/andremussche/scalemm. You can use it in practically any application, as it is released under a tri-license MPL 1.1/GPL 2.0/LGPL 2.1. It only supports the Windows platform.
ScaleMM is written in Delphi and assembler. To use ScaleMM, you just have to download it, store it somewhere on the disk and add the ScaleMM2 unit as a first unit in the program.
ScaleMM was created as a faster replacement for FastMM. It is not as loaded with debugging features as FastMM but implements just a base memory manager functionality. Because of that, it makes sense to run FastMM while debugging, and ScaleMM while testing and in production.
The older version of Delphi didn't like it if you put the {$IFDEF} directive inside the main program's uses list. Delphi will remove this directive when you add a new form to the program. The easiest way to fix this is to create a new unit and add it as a first unit in the main program's uses list. In this new unit, you can then put {$IFDEF} in the used memory manager however you wish.
An example of the uses list in such a main program is shown here:
program ParallelAllocation;
uses
ParallelAllocationMM,
Vcl.Forms,
ParallelAllocationMain in 'ParallelAllocationMain.pas' {frmParallelAllocation};
Unit ParallelAllocationMM can then be implemented as shown here:
unit ParallelAllocationMM;
interface
uses
{$IFDEF DEBUG}
FastMM4 in 'FastMM\FastMM4.pas';
{$ELSE}
ScaleMM2 in 'ScaleMM\ScaleMM2.pas';
{$ENDIF}
implementation
end.
Replacing FastMM with ScaleMM in the test program, ParallelAllocation shows a noticeable improvement. With FastMM and {$DEFINE UseReleaseStack}, the parallel version is at best 6.3x faster than the serial one. With ScaleMM it is up to 6.7x faster:

- 電腦組裝與維修從入門到精通(第2版)
- 辦公通信設備維修
- 計算機組裝·維護與故障排除
- 單片機原理及應用系統設計
- 從零開始學51單片機C語言
- Hands-On Machine Learning with C#
- Large Scale Machine Learning with Python
- 嵌入式系統中的模擬電路設計
- 單片機系統設計與開發教程
- Arduino BLINK Blueprints
- Blender Quick Start Guide
- 超大流量分布式系統架構解決方案:人人都是架構師2.0
- 基于PROTEUS的電路設計、仿真與制板
- Intel FPGA權威設計指南:基于Quartus Prime Pro 19集成開發環境
- 基于網絡化教學的項目化單片機應用技術