Re: [RFC] Cleaning up die() error messages
- From
Matthias Urlichs <smurf@smurf.noris.de>
- Date
- Oct 12, 2005, 06:04 UTC
- Message-ID
- <20051012060436.GA567@kiste.smurf.noris.de>
- In-Reply-To
- <434C8095.4080201@zytor.com>
Hi,
H. Peter Anvin:
Show 9 quoted lines
> >I thought about doing something like that, but ... > >>However, a much bigger problem is cleanup. > > > >... exactly. > > I thought about this, and probably the sanest way is to wrap malloc() > with something that creates a linked list of allocations. If we abort, > we can unwind the linked list and free all allocations. >
There already is a malloc library that does this, plus it can call cleanup for you -- there's more to cleaning up than freeing memory. :-/
Let's see if I can actually find it again.
On the other hand, I wonder if the overhead when managing data structures like that really offsets the additional work we'd need to do otherwise, which is simply checking a few more return values.
--
Matthias Urlichs | {M:U} IT Design @ m-u-it.de | smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
- -
BOFH excuse #381:
Robotic tape changer mistook operator's tie for a backup tape.