Skip to content

Commit 97de180

Browse files
jonathantanmygitster
authored andcommitted
pack: move unuse_pack()
Signed-off-by: Jonathan Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 84f80ad commit 97de180

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

cache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1639,7 +1639,6 @@ extern int odb_mkstemp(struct strbuf *template, const char *pattern);
16391639
*/
16401640
extern int odb_pack_keep(const char *name);
16411641

1642-
extern void unuse_pack(struct pack_window **);
16431642
extern void clear_delta_base_cache(void);
16441643
extern struct packed_git *add_packed_git(const char *path, size_t path_len, int local);
16451644

packfile.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,3 +596,12 @@ unsigned char *use_pack(struct packed_git *p,
596596
*left = win->len - xsize_t(offset);
597597
return win->base + offset;
598598
}
599+
600+
void unuse_pack(struct pack_window **w_cursor)
601+
{
602+
struct pack_window *w = *w_cursor;
603+
if (w) {
604+
w->inuse_cnt--;
605+
*w_cursor = NULL;
606+
}
607+
}

packfile.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ extern void close_pack_index(struct packed_git *);
4545
extern unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, unsigned long *);
4646
extern void close_pack_windows(struct packed_git *);
4747
extern void close_all_packs(void);
48+
extern void unuse_pack(struct pack_window **);
4849

4950
extern void release_pack_memory(size_t);
5051

sha1_file.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -719,15 +719,6 @@ void *xmmap(void *start, size_t length,
719719
return ret;
720720
}
721721

722-
void unuse_pack(struct pack_window **w_cursor)
723-
{
724-
struct pack_window *w = *w_cursor;
725-
if (w) {
726-
w->inuse_cnt--;
727-
*w_cursor = NULL;
728-
}
729-
}
730-
731722
static struct packed_git *alloc_packed_git(int extra)
732723
{
733724
struct packed_git *p = xmalloc(st_add(sizeof(*p), extra));

0 commit comments

Comments
 (0)