Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


It 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.


Memory safety as in the full toolset that Rust provides? C3 clearly doesn't, I fully agree.


No, by memory safety people don't mean the exact mechanisms Rust has (and therefore Rust). They mean

https://en.wikipedia.org/wiki/Memory_safety




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: