On Sun, Apr 05, 2015 at 09:36:04PM +0700, Duy Nguyen wrote:

> On Sun, Apr 5, 2015 at 11:56 AM, Jeff King <p...@peff.net> wrote:
> > So we'd have to either:
> >
> >   1. Decide that doesn't matter.
> >
> >   2. Have callers specify a "damn the NULs, I want it fast" flag.
> 
> 2+. Avoid FILE* interface and go with syscalls for reading
> packed-refs? If mmaping the entire file could be a problem for some
> platform because it's too large, we have code for reading (with
> bufferring) from fd somewhere, e.g. index-pack.

There's strbuf_getwholeline_fd, but it's horrifically inefficient (one
syscall per character). But the other option is to implement your own
buffering, and we're generally better off letting stdio do that for us
(the exception here is that stdio does not have a good NUL-safe "read
until X" function).

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to