diff options
author | Taylor Blau <me@ttaylorr.com> | 2020-09-17 16:34:42 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-17 19:29:22 +0300 |
commit | 97ffa4fab504a9c5e3b63ff886686c7f6ccd4e70 (patch) | |
tree | ef097701115ba277cbc079f675d61f6cee7fe679 /bloom.h | |
parent | b66d84756f0f3704303ddc202707ac00037ace48 (diff) |
commit-graph.c: store maximum changed paths
For now, we assume that there is a fixed constant describing the
maximum number of changed paths we are willing to store in a Bloom
filter.
Prepare for that to (at least partially) not be the case by making it a
member of the 'struct bloom_filter_settings'. This will be helpful in
the subsequent patches by reducing the size of test cases that exercise
storing too many changed paths, as well as preparing for an eventual
future in which this value might change.
This patch alone does not cause newly generated Bloom filters to use
a custom upper-bound on the maximum number of changed paths a single
Bloom filter can hold, that will occur in a later patch.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bloom.h')
-rw-r--r-- | bloom.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -28,9 +28,18 @@ struct bloom_filter_settings { * that contain n*b bits. */ uint32_t bits_per_entry; + + /* + * The maximum number of changed paths per commit + * before declaring a Bloom filter to be too-large. + * + * Not written to the commit-graph file. + */ + uint32_t max_changed_paths; }; -#define DEFAULT_BLOOM_FILTER_SETTINGS { 1, 7, 10 } +#define DEFAULT_BLOOM_MAX_CHANGES 512 +#define DEFAULT_BLOOM_FILTER_SETTINGS { 1, 7, 10, DEFAULT_BLOOM_MAX_CHANGES } #define BITS_PER_WORD 8 #define BLOOMDATA_CHUNK_HEADER_SIZE 3 * sizeof(uint32_t) |