@justinmk there's a `try_malloc` function for these situations. But what I learned after these refactorings: vim is not very careful in handling all OOM errors it was supposed to handle. It's very unlikely that it would be able to recover from this error without a `NULL` pointer being dereferenced elsewhere.

I know this for a fact: when I introduced `xmalloc` I tested `nvim` with a fail allocator and it didn't crash gracefully in any malloc failure scenario: limited memory, random failures...

We should start from what we have with `xmalloc` and have good and separate emergency functions that use `try_malloc` and are guaranteed to handle all OOM errors.