git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Pearce <spearce@spearce.org>
To: Raja R Harinath <harinath@hurrynot.org>,
	Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] fast-import: export correctly marks larger than 2^20-1
Date: Tue, 10 Aug 2010 07:20:19 -0700	[thread overview]
Message-ID: <AANLkTiniC0JeeZZeYSTg7M6WuhzJzChiqZ+9EBMoZwxQ@mail.gmail.com> (raw)
In-Reply-To: <1279021908-21291-1-git-send-email-harinath@hurrynot.org>

On Tue, Jul 13, 2010 at 4:51 AM, Raja R Harinath <harinath@hurrynot.org> wrote:
> dump_marks_helper() has a bug when dumping marks larger than 2^20-1,
> i.e., when the sparse array has more than two levels.  The bug was
> that the 'base' counter was being shifted by 20 bits at level 3, and
> then again by 10 bits at level 2, rather than a total shift of 20 bits
> in this argument to the recursive call:
>
>  (base + k) << m->shift
>
> There are two ways to fix this correctly, the elegant:
>
>  (base + k) << 10
>
> and the one I chose due to edit distance:
>
>  base + (k << m->shift)
>
> Cc: Shawn O. Pearce <spearce@spearce.org>
> Signed-off-by: Raja R Harinath <harinath@hurrynot.org>

Dang, that's a very old bug.  This change makes sense, thanks.

Acked-by: Shawn O. Pearce <spearce@spearce.org>

-- 
Shawn.

      parent reply	other threads:[~2010-08-10 14:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-13 11:51 [PATCH] fast-import: export correctly marks larger than 2^20-1 Raja R Harinath
2010-07-13 18:31 ` Jonathan Nieder
2010-07-14  6:48   ` Raja R Harinath
2010-08-10 14:20 ` Shawn Pearce [this message]

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=AANLkTiniC0JeeZZeYSTg7M6WuhzJzChiqZ+9EBMoZwxQ@mail.gmail.com \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=harinath@hurrynot.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).