kerla icon indicating copy to clipboard operation
kerla copied to clipboard

Eliminate implicit out-of-memory panics

Open nuta opened this issue 4 years ago • 3 comments

Currently. Kerla extensively uses containers provided by liballoc. The problem is they can panic on memory allocation failures. Use failable methods (i.e. returning Result<T>) to improve the robustness.

Alternatives to liballoc

  • Scapegoat - Ordered set and map data structures

nuta avatar Nov 01 '21 13:11 nuta

Interested in working on this one, but I can't start now such large assignment.

michalfita avatar Nov 01 '21 15:11 michalfita

Great! You don't need to replace all at once. Let's improve the existing implicit panics gradually just like #29.

nuta avatar Nov 02 '21 08:11 nuta

I took a peek at basic use of alloc in Kerla and what Scapegoat offers and I think it's apples vs. oranges. I remember originally one more crate mentioned, but it's gone now.

I'm afraid replacing Box<T> with something that may gracefully fail is going to be deeply non-trivial as many containers will assume a Box<T> instance can be consumed.

michalfita avatar Nov 12 '21 16:11 michalfita