git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Junio C HamanoNext: Daniel Barkalow
Message 10 of 13 in “[RFC] Cleaning up die() error messages”
  1. Elfyn McBratneyOct 10, 2005
  2. Junio C HamanoOct 10, 2005
  3. Matthias UrlichsOct 11, 2005
  4. H. Peter AnvinOct 11, 2005
  5. Matthias UrlichsOct 12, 2005
  6. H. Peter AnvinOct 12, 2005
  7. Junio C HamanoOct 12, 2005
  8. H. Peter AnvinOct 12, 2005
  9. Junio C HamanoOct 12, 2005
  10. Matthias UrlichsOct 12, 2005
  11. Daniel BarkalowOct 10, 2005
  12. Alex RiesenOct 11, 2005
  13. H. Peter AnvinOct 11, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.