Re: [PATCH v2 5/9] pack-bitmap: introduce bitmap_walk_contains()
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Oct 19, 2019, 18:55 UTC
- Message-ID
- <CAP8UFD2dLPguCnUhTu+F4SNPxFZ7YT5io0qXkVwvSNP-sA8Jxg@mail.gmail.com>
- In-Reply-To
- <dce8e0b5-c4ea-f4f6-6275-1322f2d7200b@iee.email>
Hi Philip,
On Sat, Oct 19, 2019 at 5:25 PM Philip Oakley <philipoakley@iee.email> wrote:
> > Hi Christian, > can I check one thing?
Yeah, sure! Thanks for taking a look at my patches!
> On 19/10/2019 11:35, Christian Couder wrote:
Show 11 quoted lines
> > +int bitmap_walk_contains(struct bitmap_index *bitmap_git,
> > + struct bitmap *bitmap, const struct object_id *oid)
> > +{
> > + int idx;
> Excuse my ignorance here...
>
> For the case on Windows (int/long 32 bit), is this return value
> guaranteed to be less than 2GiB, i.e. not a memory offset?
>
> I'm just thinking ahead to the resolution of the 4GiB file limit issue
> on Git-for-Windows (https://github.com/git-for-windows/git/pull/2179)I understand your concern, unfortunately, below we have:
idx = bitmap_position(bitmap_git, oid);
and bitmap_position() returns an int at least since 3ae5fa0768 (pack-bitmap: remove bitmap_git global variable, 2018-06-07)
So I think the fix would be much more involved than just changing the type of the idx variable. It would likely involve modifying bitmap_position(), and thus would probably best be addressed in a separate patch series.
Show 7 quoted lines
> > + > > + if (!bitmap) > > + return 0; > > + > > + idx = bitmap_position(bitmap_git, oid); > > + return idx >= 0 && bitmap_get(bitmap, idx); > > +}