3 ms·
I agree Rust should have it, but it is VERY hard to do correctly. I've worked on some systems which claimed they were dealing with it, but when I purposefully
by CJefferson 6y ago
I agree Rust should have it, but it is VERY hard to do correctly.
I've worked on some systems which claimed they were dealing with it, but when I purposefully pushed it (by making a malloc which would occasionally fail), I quickly uncovered dozens of bugs, and the solution was to stop pretending would could sensibly handle low-memory situations. SQLite famously does handle this situation correctly, but it is a huge amount of work.
- Fronzie 6y agoThere are counter examples. For example, data processing as part of a measurement application: If allocating the data fails, the application should abort that, but keep running to allow further control and let the user reduce e.g. the sampling size. I know of one application with a worldwide customer base that supports this.
- zlynx 6y agoYes, if allocation failure is not tested, it is not likely to work correctly. SQLite is also famous for its strict and complete test sets.
- darthrupert 6y agoCheck out Zig. That language will work much better as a kernel/driver language because it is simple by design.