-
- Downloads
Handle allocation failures
In a similar way to the C version of ncdu: by wrapping malloc(). It's simpler to handle allocation failures at the source to allow for easy retries, pushing the retries up the stack will complicate code somewhat more. Likewise, this is a best-effort approach to handling OOM, allocation failures in ncurses aren't handled and display glitches may occur when we get an OOM inside a drawing function. This is a somewhat un-Zig-like way of handling errors and adds scary-looking 'catch unreachable's all over the code, but that's okay.
Showing
- README.md 0 additions, 1 deletionREADME.md
- src/browser.zig 18 additions, 18 deletionssrc/browser.zig
- src/main.zig 32 additions, 11 deletionssrc/main.zig
- src/model.zig 22 additions, 15 deletionssrc/model.zig
- src/scan.zig 26 additions, 27 deletionssrc/scan.zig
- src/ui.zig 28 additions, 10 deletionssrc/ui.zig
- src/util.zig 2 additions, 2 deletionssrc/util.zig
Loading
Please register or sign in to comment