4 ms·
No, I'm just saying that what memory is allocated (as in the language) is not necessarily the same as the memory that is allocated as in your intentions. It's p
by robalni 6y ago
No, I'm just saying that what memory is allocated (as in the language) is not necessarily the same as the memory that is allocated as in your intentions.
It's possible to allocate (as in language) an array that is longer than what you really need,
and when you are done using some of the memory in that array you might not want to call any free/realloc functions in order to make the program faster.
So instead you might want to just remember that the memory is unallocated (as in intentions) even if it's still allocated (as in language).
And now there is a disagreement between you and the language on what memory is allocated.
No "memory-safe" language can make sure you don't accidently use memory unintentionally.
With that said, languages like Rust really give you helpful tools to minimize the unintentional memory accesses.
- saagarjha 6y agoOh, I guess that is fair.