Graceful error on inability to allocate cache
|Reported by:||Anthony J. Bentley||Owned by:|
$ ulimit -d 524288 $ 0ad Cache: 500 (total: 3975) MiB terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Abort trap (core dumped) $
There's nothing wrong with failing here. But the error message plus coredump is a little unfriendly, especially since people who use the .desktop file will not not see the error message.
It would be nice if 0ad were to cleanly error out (via a graphical message box?) and exit if it can't allocate enough memory at the beginning.
Yes, these ulimits are low, but they are the default on some platforms like OpenBSD. A more readable error message would help new users realize the problem sooner.