Hacker News new | ask | show | jobs
by benji-york 225 days ago
> Zig doesn't even pretend to do memory safety - if you don't free something manually it won't get freed

Preventing memory leaks isn't normally what people mean by "memory safety".

As an aside: a common memory management approach used in Zig is to have a dedicated memory pool for an operation and simply free all of the memory after the operation is over instead of freeing individual allocations.

1 comments

> Preventing memory leaks isn't normally what people mean by "memory safety".

People do sometimes expect it to be encompassed by memory safety, even though the Rust documentation clearly states that it does not prevent memory leaks in safe code and offers several obvious ways to deliberately leak memory.