Am Sonntag, 24. August 2008 22:55:48 schrieb Per Inge Mathisen: > On Sun, Aug 24, 2008 at 5:42 PM, Giel van Schijndel <[EMAIL PROTECTED]> wrote: > > * Change an ASSERT that checks calloc's return value into an if() block > > (we can also run out of memory on non-debug builds...) > > I am also rather mystified by this. When we fail to allocate memory > and do not handle it gently, the next thing that happens is inevitably > a crash when the null pointer is accessed. There is no reason to > ensure that a crash happens with a call to abort() - if we are not > going to attempt recovery, we just need to ensure that something is > written to the log in order to debug it. Adding a five line > conditional to every memory allocation is rather pointless and just > bloats the code. *Maybe* a real crash can corrupt something or is not always handled correctly?
Aside of that I think we could add a out-of-memory "handler", or some more generic way of handling the most common errors. Why? So we can inform the user in a nicer manner than "application X was terminated in an unusual way". (Console output now, maybe error popup windows later.) --Devurandom
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Warzone-dev mailing list Warzone-dev@gna.org https://mail.gna.org/listinfo/warzone-dev