|
|
|
|
|
by kibwen
3984 days ago
|
|
I didn't get to see which issue was linked before the original poster deleted their comments, but in the original comment they mentioned the Dining Philosophers chapter from the book which cannot exhibit the leak from that issue because it doesn't define any destructors (let alone define any potentially-panicking destructors, let alone attempt to catch any panics, all of which would be required to observe such a leak). |
|
" the Dining Philosophers chapter from the book which cannot exhibit the leak from that issue because it doesn't define any destructors (let alone define any potentially-panicking destructors, let alone attempt to catch any panics, all of which would be required to observe such a leak)."
Since when can memory leaks only be observed from within the language itself? There are a number of tools that are used on a regular basis to observe memory leaks, with many of them being entirely language agnostic. Additionally, the entire issue brought up in the deleted comment was in relation to threads, an argument of a lack of user-defined destructors wasn't brought into question at all.
Glancing briefly over the section of the Rust book in question here, the above two lines appear in the code. In any language, whenever memory is used and then not freed there is a leak. A leak may have nothing to do with a destructor in a language, but could relate to code generation, etc..As I linked to the other commentator who was assured the individual in question (whose comment is now deleted) was incorrect, Alex Crichton (one of Rust's main contributors) posted a valgrind example yesterday on one of the issues that individual linked (https://github.com/rust-lang/rust/issues/19776).
The original comment mentioning this issue was lacking so in confrontational qualities that the responses he or she received here and on twitter (how I myself arrived here) were entirely unwarranted.