Comment by landr0id
1 hour ago
I still don't think that does anything regarding use-after-frees, only double-frees.
Here's the code: https://codeberg.org/ziglang/zig/src/commit/e44e927d33d37c44...
The closest callout in the doc comment is:
>Never reuses memory addresses, making it easier for Zig to detect branch on undefined values in case of dangling pointers. This relies on the backing allocator to also not reuse addresses.
But it's not really clear what this means. "branch on undefined values" would I think indicate that maybe they're doing a fill pattern that the compiler can detect at runtime when dereferenced? But I don't see it in the `free` path. It's not clear if this is deterministic or not either.
No comments yet
Contribute on Hacker News ↗