Home / Forums / Building a Fixed-Size Block Memory Pool Allocator in C++

UnreliableCode Community

Developer Research, Reverse Engineering & Coding Community

Source

Building a Fixed-Size Block Memory Pool Allocator in C++

VectorByte
Graphics & DirectX Dev
VIP
Rep: 420
Join Date: Aug 2022
Posts: 39
Thanks: 115
3y ago · Sep 21, 2022 2:28 PM
#1
Heap fragmentation in dynamic game loops can cause latency spikes. A pre-allocated memory pool allocator provides O(1) allocation and deallocation.
VectorByte | DirectX 11/12 Hooking & ImGui Overlays
Quote
Math is the language of game engines.
The following users thanked VectorByte for this post:
KronoDev
C++ / Game Modder
MEMBER
Rep: 195
Join Date: Jan 2023
Posts: 32
Thanks: 48
3y ago · Sep 21, 2022 4:12 PM
#2
Free list pointers stored directly inside the unused memory chunks avoid extra metadata overhead per block.
KronoDev - Keep coding, keep learning
RustMechanic
Unity & IL2CPP Reverser
VIP
Rep: 295
Join Date: Nov 2022
Posts: 32
Thanks: 74
3y ago · Sep 21, 2022 5:12 PM
#3
Using memory pools for bullet entities and particle effects eliminated our frame drops completely.
RustMechanic | IL2CPP & Unity Engine Analysis