3 ms·
No, that is quite possible. You will not be able to use that memory you just returned though. What actually happens is an implementation issue, but it ranges fr
by lerno 1y ago
No, that is quite possible. You will not be able to use that memory you just returned though. What actually happens is an implementation issue, but it ranges from having the memory overwritten (but still being writable) on platforms with the least support, to being neither read or writable, to throwing an exact error with ASAN on. Crashing on every use is often a good sign that there is a bug.
- unscaled 1y agoIt might not be on every use though. The assignment could very well be conditional. If a dangling reference could escape from the arena in which it was allocated, you cannot claim to have memory safety. You can claim that the arena prevents memory leaks (if you remember to allocate everything correctly within the arena), but it doesn't provide memory safety.
- lerno 1y agoMemory safety as in the full toolset that Rust provides? C3 clearly doesn't, I fully agree.
- bmacho 1y agoNo, by memory safety people don't mean the exact mechanisms Rust has (and therefore Rust). They mean https://en.wikipedia.org/wiki/Memory_safety https://en.wikipedia.org/wiki/Memory_safety