Re: [PATCH v2 2/4] progress: fix progress meters when dealing with lots of work
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Nov 13, 2017, 20:28 UTC
- Message-ID
- <20171113122834.20a69d1e87defe95d6e0e8ed@google.com>
- In-Reply-To
- <20171113201600.24878-3-newren@gmail.com>
On Mon, 13 Nov 2017 12:15:58 -0800 Elijah Newren <newren@gmail.com> wrote:
Show 11 quoted lines
> The possibility of setting merge.renameLimit beyond 2^16 raises the > possibility that the values passed to progress can exceed 2^32. > Use uint64_t, because it "ought to be enough for anybody". :-) > > Signed-off-by: Elijah Newren <newren@gmail.com> > --- > This does imply 64-bit math for all progress operations. Possible alternatives > I could think of listed at > https://public-inbox.org/git/CABPp-BH1Cpc9UfYpmBBAHWSqadg=QuD=28qx1oV29ZdvF4NbJw@mail.gmail.com/ > Opinions of others on whether 64-bit is okay, or preference for which alternative > is picked?
I haven't looked into this in much detail, but another alternative to consider is to use size_t everywhere. This also allows us to use st_add and st_mult, which checks overflow for us.
Changing progress to use the size_t of the local machine makes sense to me.