3 ms·
An effects system. A safe stdlib - aborting on malloc failure is not safe.
by nwmcsween 11y ago
An effects system.
A safe stdlib - aborting on malloc failure is not safe.
- kzrdude 11y agoThen you are using a different meaning for safe than what Rust usually does. Abort occurs on oom, that's right and also on double panic (most frequently found if a destructor panics during unwinding).
- Manishearth 11y agolibcore and no_std is what you want to use if you want finer-grained malloc-free control over things.
- gnuvince 11y agoI'd need to recheck my vocab, but I'm pretty sure aborting is always safe.
- ajb 11y agoNot if you want to write an OS.
- rcxdude 11y agoThen you won't use the stdlib anyway.
- steveklabnik 11y agoRust's usage of 'unsafe' refers to a very specific thing: memory safety. Aborts are always safe, though they may not be what you want, of course.