Memory Management Part 2: Allocations Tracking
Introduction In this post, I’ll cover the basics of memory allocations tracking. If you haven’t read my previous post on allocation strategy, make sure to read it before continuing. Here’s what we want...
View ArticleHashing Strings and Pointers – Avoiding Common Pitfalls
Introduction In a previous post, I suggested using fixed size hash tables to map strings and pointers. Since this code really needs to be fast, reducing hash collisions probabilities is very important...
View ArticleUsing the Moving Average Filter for Profiling Stats
Introduction When displaying profiling stats or FPS counters or whatever value that varies a lot frame to frame, you don’t want to show the real values since they can vary too much and make the stats...
View ArticleMemory Management Part 3: Memory Allocators Design
Introduction Writing a simple memory allocator is quite easy. Writing an efficient allocator that tries to minimize fragmentation, overhead and locking while trying to maximize locality of reference...
View ArticleUnderstanding Atomic Operations
Introduction Atomic operations are the building blocks of synchronization primitives and non-blocking algorithms. They guarantee that, when modifying a memory location, it will happen without any...
View ArticleTrigonometric Look-Up Tables Revisited
Introduction In my spare time, I’m working on a 2D game that relies on huge amount of entities being updated and displayed every frame, at 60FPS. This requires to have a permanent eye on overall...
View ArticleMemory Management Part 4: Allocators Overhead, Waste and Fragmentation
Introduction As seen in my previous post on allocations tracking, tracking memory allocations is an essential tool for any medium to large-scale game engine. Every AAA games I’ve worked on for the last...
View ArticleUnderstanding Memory Ordering
Introduction In a previous post on atomic operations, I skipped an important topic, which is memory ordering issues. Behind the hood, the processor might reorder memory operations (reads and writes)...
View ArticleImplementing a recursive read-write spinlock
Very often I see programmers using a critical section to make some code thread-safe. What happens is that most of the time, the protected code will only read data, while blocking other reading threads...
View ArticleOptimizing the recursive read-write spinlock
In my previous post on implementing a recursive read-write spinlock, I briefly talked about trivial optimizations that could be done to improve the time spent in the lock functions. In this post, we’ll...
View Article
More Pages to Explore .....