2 * Copyright (C) the libgit2 contributors. All rights reserved.
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
8 #ifndef INCLUDE_pack_objects_h__
9 #define INCLUDE_pack_objects_h__
22 #include "git2/pack.h"
24 #define GIT_PACK_WINDOW 10 /* number of objects to possibly delta against */
25 #define GIT_PACK_DEPTH 50 /* max delta depth */
26 #define GIT_PACK_DELTA_CACHE_SIZE (256 * 1024 * 1024)
27 #define GIT_PACK_DELTA_CACHE_LIMIT 1000
28 #define GIT_PACK_BIG_FILE_THRESHOLD (512 * 1024 * 1024)
30 typedef struct git_pobject
{
37 unsigned int hash
; /* name hint hash */
39 struct git_pobject
*delta
; /* delta base object */
40 struct git_pobject
*delta_child
; /* deltified objects who bases me */
41 struct git_pobject
*delta_sibling
; /* other deltified objects
42 * who uses the same base as
57 unsigned int uninteresting
:1,
61 struct git_packbuilder
{
62 git_repository
*repo
; /* associated repository */
63 git_odb
*odb
; /* associated object database */
75 git_pobject
*object_list
;
77 git_oidmap
*object_ix
;
79 git_oidmap
*walk_objects
;
82 git_oid pack_oid
; /* hash of written pack */
84 /* synchronization objects */
85 git_mutex cache_mutex
;
86 git_mutex progress_mutex
;
87 git_cond progress_cond
;
90 size_t delta_cache_size
;
91 size_t max_delta_cache_size
;
92 size_t cache_max_small_delta_size
;
93 size_t big_file_threshold
;
94 size_t window_memory_limit
;
96 unsigned int nr_threads
; /* nr of threads to use */
98 git_packbuilder_progress progress_cb
;
99 void *progress_cb_payload
;
100 double last_progress_report_time
; /* the time progress was last reported */
105 int git_packbuilder_write_buf(git_buf
*buf
, git_packbuilder
*pb
);
107 #endif /* INCLUDE_pack_objects_h__ */