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

Re: QGit: Shrink used memory with custom git log format

From
JHJan Hudec <bulb@ucw.cz>
Date
Nov 27, 2007, 19:19 UTC
Message-ID
<20071127191915.GB9174@efreet.light.src>
In-Reply-To
<Pine.LNX.4.64.0711271045430.27959@racer.site>
On Tue, Nov 27, 2007 at 10:48:00 +0000, Johannes Schindelin wrote:
Show 12 quoted lines
> On Mon, 26 Nov 2007, Shawn O. Pearce wrote:
> > [...]
> > Otherwise I think what you really want here is a libgit that you can
> > link into your process and that can efficiently inflate an object
> > on demand for you.  Like the work Luiz was working on this past
> > summer for GSOC.  Lots of downsides to that current tree though...
> > like die() kills the GUI...
> 
> But then, die() calls die_routine, which you can override.  And C++ has 
> this funny exception mechanism which just begs to be used here.  The only 
> thing you need to add is a way to flush all singletons like the object 
> array.

Unfortunately, exceptions won't really work. Why? Because to use exceptions, you need to have an exception-safe code. That is the code needs to free any allocated resources when it's aborted by exception. And git code is not exceptions safe. Given the lack of destructors in C, it means registering all resource allocation in some kind of pool, so they can be freed en masse in case of failure. Than you can also use longjmp for die (for C they really behave the same).

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
Previous: Marco CostalbaNext: Johannes Schindelin
Message 5 of 7 in “QGit: Shrink used memory with custom git log format”
  1. Marco CostalbaNov 24, 2007
  2. Shawn O. PearceNov 27, 2007
  3. Johannes SchindelinNov 27, 2007
  4. Marco CostalbaNov 27, 2007
  5. Jan HudecNov 27, 2007
  6. Johannes SchindelinNov 28, 2007
  7. jhud7196@artax.karlin.mff.cuni.czNov 28, 2007

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.