Hi Rink,
> I agree with that... write a void* sci_malloc(unsigned long) function, that
> calls deinits, prints a message and dies whenever the allocation fails.
That's roughly what the glib macros do (except for the deinitialization
part).
[implementation]
> exit(100);
Does exit code 100 mean something special I'm not aware of?
If we'd want to do it that way, then we could just use g_malloc, g_new,
g_realloc, g_new0 etc. (that's what I did for src/core/* today).
We wouldn't need to deinitialize, though; the sound server will die of
SIGPIPE sooner or later (this has to be improved, BTW), the graphics
system usually has minimum clean-up functions registered atexit(3), and
memory is freed automatically. Any other cleanup stuff we might add later
(can't think of anything, though) could be registered to be executed at
exit, too.
Chris' concept of waiting until memory becomes available isn't going to
help too much if we're really short on memory (the FreeSCI process is
likely to be one of the first processes to get slaughtered by the admins),
but it's the most technically correct solution- after all, memory shortage
is supposed to be a recoverable problem.
llap,
Christoph