2 ms·
You're correct but that's kind-of missing the point: I imagine the parent was trying to say you can have the deterministic management of non-memory resources li
by dbaupp 10y ago
You're correct but that's kind-of missing the point: I imagine the parent was trying to say you can have the deterministic management of non-memory resources like C++, without the downside of loosing memory safety.
It's low-signal to say that memory leaks are possible, since, as the article in question demonstrates, it's perfectly possible to get leaks in languages like Java.
On `forget`, it's equivalent to the following Python, which can be translated into pretty much any language one wants:
holds_reference = []
def forget(x):
global holds_references
holds_reference.append(x)
There are cases where one needs to think about avoiding leaks, but no more than C++.
- marcosdumay 10y ago> I imagine the parent was trying to say you can have the deterministic management of non-memory resources like C++, without the downside of loosing memory safety. At least, that's what I was talking about. But the GP has a point. It will leak other resources the same way it leaks memory. That is, it will rarely do so, but it's something you have to keep in mind.