Re: read() MAX_IO_SIZE bytes, more than SSIZE_MAX?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 7, 2015, 22:13 UTC
- Message-ID
- <CAPc5daUnKcktv0xcz-fGEApckbkQksKuZO53ZL20E1MhtZmn4w@mail.gmail.com>
- In-Reply-To
- <54D67662.7040504@web.de>
On Sat, Feb 7, 2015 at 12:32 PM, Torsten Bögershausen <tboegi@web.de> wrote:
Show 8 quoted lines
> I don't know every platform of the planet well enough to be helpful here, > especially the ones which don't follow all the specifications. > > In other words: As long as we can not guarantee that SSIZE_MAX is defined, > (and is defined to somethong useful for xread()/xwrite() ) > we should be more defensive here: > > tweak only on platform where we know it is needed and we know that it works.
Yup, I agree that is a sensible way to go.
(1) if Makefile overrides the size, use it; otherwise (2) if SSIZE_MAX is defined, and it is smaller than our internal default, use it; otherwise (3) use our internal default.
And leave our internal default to 8MB.
That way, nobody needs to do anything differently from his current build set-up, and I suspect that it would make step (1) optional.