git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Jan Hudec <bulb@ucw.cz>
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
	Marco Costalba <mcostalba@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: QGit: Shrink used memory with custom git log format
Date: Wed, 28 Nov 2007 12:01:36 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0711281200070.27959@racer.site> (raw)
In-Reply-To: <20071127191915.GB9174@efreet.light.src>

Hi,

On Tue, 27 Nov 2007, Jan Hudec wrote:

> On Tue, Nov 27, 2007 at 10:48:00 +0000, Johannes Schindelin wrote:
> > 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).

Sorry, I just assumed that you can read my mind (or alternatively remember 
what I suggested a few months ago, namely to "override" xmalloc(), 
xcalloc(), xrealloc() and xfree() (probably you need to create the 
latter)).

Ciao,
Dscho

  reply	other threads:[~2007-11-28 12:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-24  8:14 QGit: Shrink used memory with custom git log format Marco Costalba
2007-11-27  1:52 ` Shawn O. Pearce
2007-11-27 10:48   ` Johannes Schindelin
2007-11-27 12:36     ` Marco Costalba
2007-11-27 19:19     ` Jan Hudec
2007-11-28 12:01       ` Johannes Schindelin [this message]
2007-11-28 15:53         ` jhud7196

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0711281200070.27959@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=bulb@ucw.cz \
    --cc=git@vger.kernel.org \
    --cc=mcostalba@gmail.com \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).