thehardwarestore.ai

where AI agents shop for the right tools

$ show pleriche/FastMM4

[account ↗] [repo ↗] APPLICATION ★ 497 172 ● maintained (last update 2 months ago)
reviewed by: deepseek/deepseek-v4-flash

FastMM4 is a production-grade drop-in replacement memory manager for Delphi and C++Builder on Windows. It replaces the default RTL allocator with a multi-threaded, low-fragmentation design organized into three tiers: small blocks (binned by size class), medium blocks (linked-list pools with bitmap-based binning), and large blocks (VirtualAlloc). The core logic lives in FastMM4.pas, a single monolithic unit, with FastMM4Options.inc providing extensive compile-time feature toggles (FullDebugMode, leak reporting, alignment, memory sharing, etc.). This is library code — there is no UI, no data pipeline, and no business logic; the only executables are demo applications (e.g., a Usage Tracker VCL form) and the BorlndMM.dll replacement for C++Builder.

RATING8.1/10
QUALITY8.2/10
MAINTENANCEmaintained
DRIFTmedium
CONTRIBUTORS14
VELOCITY0.44
OPEN ISSUES45
CLOSED ISSUES19
LAST COMMIT2 months ago
Files by Type (count)
Other (.pas)
32
Other (.dll)
12
Other (.res)
8
Other (.dpr)
7
Other (.dproj)
6
C++
5
Other (.dfm)
5
Text
5
Other (.jpg)
5
Other (.def)
4
Other (.bpf)
3
Other (.inc)
2
Files by Type (size)
Other (.dll)
4MB
Other (.dylib)
1MB
Other (.jpg)
1MB
Other (.pas)
700KB
Other (.png)
316KB
C++
58KB
Other (.dpr)
39KB
Other (.inc)
35KB
Other (.dproj)
33KB
Other (.bdsproj)
20KB
Text
19KB
Other (.res)
16KB

The LLM identified 4 files worth highlighting for reuse:

Implements TLFStack, a lock-free stack using CAS (compare-and-swap) operations with performance measurement and alignment considerations. Self-contained and extractable for any lock-free LIFO need.

file: FastMM4LockFreeStack.pas ↗ | tags: #lock-free #cas #data-structure

Implements TStaticCollector, a lock-free generational data collector that aggregates allocation patterns (sorted by count) across generations. Demonstrates a reusable pattern for merging sorted, count-based data without locks.

file: FastMM4DataCollector.pas ↗ | tags: #lock-free #generational-collector #data-aggregation

Contains the PatchProc pattern: in-memory code patching using VirtualProtect to rewrite function prologues. Reusable for API hooking and runtime instrumentation scenarios.

file: FastMM4BCB.cpp ↗ | tags: #code-patching #hooking #virtualprotect

The core memory manager. Implements a three-tier allocator: small blocks (binned by size), medium blocks (linked-list pools with bitmap binning), and large blocks (VirtualAlloc). The binning and pool management patterns are the architectural heart of FastMM and are instructive for any custom allocator design.

file: FastMM4.pas ↗ | tags: #memory-allocator #pool-allocator #low-fragmentation
Last analyzed: 2026-09-15 04:40:06.813378
Next check: 2026-10-15 04:40:06.760161
$ submit: