The Zig standard library is finally gaining a general purpose allocator. Importantly, it is *safe*. Here it is integrated with Zig's unit tests, catching memory leaks and double-free.

Follow

Use-after-free is not always detected, but it is safe because it avoids using the same memory addresses, thereby preventing memory corruption. This test has an undetected use-after-free bug, however, its behavior is still well-defined and no memory corruption occurs.

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!