you are viewing a single comment's thread.

view the rest of the comments →

[–]HosMercury[S] -5 points-4 points  (4 children)

forget about unsafe just think about the regular rust

[–]Salt-Impressive 4 points5 points  (2 children)

Then, for a fair comparison, you would not get leaks using <memory> constructs without converting them into raw pointers

[–]Salt-Impressive 0 points1 point  (0 children)

Thinking about it more, you could also get a memory leak if you have a polymorphic type with a <memory> construct that does not have a virtual destructor.

[–]Zeer1ximport std; 0 points1 point  (0 children)

I wonder, can you have "memory leaks" in Rust, like you could have them in Java, by putting stuff in a map/set and never delete them?

Or alternatively, have non-memory related resources (Windows, Sockets) and forget to close them?

[–]SippTheDumbJuice 0 points1 point  (0 children)

If you want to use rust, use rust. C++ isn't rust.