The Curious Case of a Memory Leak in a Zig program

iamkroot.github.io/blog/zig-memleak

This is a small exposition on an unexpected "memory leak" I encountered when writing a Zig program. We will mainly focus on a very simple allocation pattern and see how it causes a "leak" (you will see why I am putting it in quotes) when using a particular allocator from Zig's stdlib.
Advent of Code 2022 gave me an excuse to learn the Zig programming language. It is touted to…

This story appeared on github.io, 2023-03-19.
Read the Entire Internet on a Single Page. Join Now →