News for hackers. Stuff that matters.
Re:Haskell's Children by Jtsummers on Wednesday September 23, 2020 @02:34PM (#24570333)
The common memory-related bugs are:

- use after free

- memory leaks (failing to free)

- concurrent and uncontrolled access from multiple threads (race conditions)

Garbage collection helps with the first two. The system will not free memory until it is certain (by whatever method is being used) that the memory is no longer in use. But this comes with a run-time cost. Rust's innovation here is a more reliable way of tracking memory usage statically, and removes some of the run-time cost. Paired with its ownership/borrow mechanisms it also works to solve the third issue, which GC doesn't deal with at all.

There are no comments on this comment yet.