Re: [PATCH v2 13/21] packed_ref_cache: keep the `packed-refs` file mmapped if possible

2017-09-24 Thread Junio C Hamano
Michael Haggerty writes: >> +struct stat st; >> +size_t size, bytes_read; > > Coverity helpfully pointed out that `bytes_read` has to be signed: > `ssize_t`. I'll fix that in the next round after waiting for other comments. Thanks. The macOS build at Travis also

Re: [PATCH v2 13/21] packed_ref_cache: keep the `packed-refs` file mmapped if possible

2017-09-21 Thread Michael Haggerty
On 09/20/2017 08:40 PM, Jeff King wrote: > [...] > The overall strategy for this compile-time knob makes sense, but one > thing confused me: > >> +ifdef MMAP_PREVENTS_DELETE >> +BASIC_CFLAGS += -DMMAP_PREVENTS_DELETE >> +else >> +ifdef USE_WIN32_MMAP >> +BASIC_CFLAGS +=

Re: [PATCH v2 13/21] packed_ref_cache: keep the `packed-refs` file mmapped if possible

2017-09-20 Thread Jeff King
On Wed, Sep 20, 2017 at 02:40:58PM -0400, Jeff King wrote: > > +enum mmap_strategy { > > + /* > > +* Don't use mmap() at all for reading `packed-refs`. > > +*/ > > + MMAP_NONE, > > + > > + /* > > +* Can use mmap() for reading `packed-refs`, but the file must > > +* not

Re: [PATCH v2 13/21] packed_ref_cache: keep the `packed-refs` file mmapped if possible

2017-09-20 Thread Jeff King
On Tue, Sep 19, 2017 at 08:22:21AM +0200, Michael Haggerty wrote: > Keep a copy of the `packed-refs` file contents in memory for as long > as a `packed_ref_cache` object is in use: > > * If the system allows it, keep the `packed-refs` file mmapped. > > * If not (either because the system

Re: [PATCH v2 13/21] packed_ref_cache: keep the `packed-refs` file mmapped if possible

2017-09-19 Thread Michael Haggerty
On 09/19/2017 08:22 AM, Michael Haggerty wrote: > Keep a copy of the `packed-refs` file contents in memory for as long > as a `packed_ref_cache` object is in use: > > * If the system allows it, keep the `packed-refs` file mmapped. > > * If not (either because the system doesn't support `mmap()`

[PATCH v2 13/21] packed_ref_cache: keep the `packed-refs` file mmapped if possible

2017-09-19 Thread Michael Haggerty
Keep a copy of the `packed-refs` file contents in memory for as long as a `packed_ref_cache` object is in use: * If the system allows it, keep the `packed-refs` file mmapped. * If not (either because the system doesn't support `mmap()` at all, or because a file that is currently mmapped cannot