Junio C Hamano <gitster@xxxxxxxxx> wrote: > "Shawn O. Pearce" <spearce@xxxxxxxxxxx> writes: > > > +extern void close_pack_windows(struct packed_git *, int); > > Nobody seems to pass anything but true in retain_fd parameter. > Is it worth it? Hmm, well, I originally wrote something like what you fixed it to be, then thought that at some point in the future someone may try to invoke the method and expect different semantics than it implemented. :-) In short I made the implementation I gave you way too complex. > So I'd prefer something much simpler like this one instead... > > void close_pack_windows(struct packed_git *p) > { > while (p->windows) { > struct pack_window *w = p->windows; > > if (w->inuse_cnt) > die("pack '%s' still has outstanding windows", > p->pack_name) > munmap(w->base, w->len); > pack_mapped -= w->len; > pack_open_windows--; > p->windows = w->next; > free(w); > } > } Me too. Thank you for the sanity check, and for fixing the code to actually be somewhat sane. -- Shawn. - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html