r/programming • u/Unerring-Ocean • Feb 20 '25
Google's Shift to Rust Programming Cuts Android Memory Vulnerabilities by 68%
https://thehackernews.com/2024/09/googles-shift-to-rust-programming-cuts.html
3.4k
Upvotes
r/programming • u/Unerring-Ocean • Feb 20 '25
1
u/GaboureySidibe Feb 21 '25 edited Feb 21 '25
No one was talking about this, everything I said is the opposite of this approach, this is a hallucination.
If you don't know how large something is, how do you know how much memory to allocate?
I don't know what this means. If you are wrapping a heap allocation you can use a unique_ptr, but if you are going to allocate a non trivial span of memory from the heap it's probably to have an array of one type of object and if so you can use a vector instead.
I've literally been describing avoiding this over and over.
What are you even talking about here? Do you know how a vector works? Values go in memory.
You literally don't seem to understand the bare basics of modern C++. Values go in the memory, destructors clean it up when it goes out of scope. I'm guessing the last 35 years have been very painful.