git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
7f40c751f725c647db723e941bf6f66310cd432b blob 1247 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
 
#ifndef BLOOM_H
#define BLOOM_H

struct commit;
struct repository;
struct commit_graph;

struct bloom_filter_settings {
	uint32_t hash_version;
	uint32_t num_hashes;
	uint32_t bits_per_entry;
};

#define DEFAULT_BLOOM_FILTER_SETTINGS { 1, 7, 10 }
#define BITS_PER_WORD 64

/*
 * A bloom_filter struct represents a data segment to
 * use when testing hash values. The 'len' member
 * dictates how many uint64_t entries are stored in
 * 'data'.
 */
struct bloom_filter {
	uint64_t *data;
	int len;
};

/*
 * A bloom_key represents the k hash values for a
 * given hash input. These can be precomputed and
 * stored in a bloom_key for re-use when testing
 * against a bloom_filter.
 */
struct bloom_key {
	uint32_t *hashes;
};

void load_bloom_filters(void);

void fill_bloom_key(const char *data,
		    int len,
		    struct bloom_key *key,
		    struct bloom_filter_settings *settings);

void add_key_to_filter(struct bloom_key *key,
					   struct bloom_filter *filter,
					   struct bloom_filter_settings *settings);

struct bloom_filter *get_bloom_filter(struct repository *r,
				      struct commit *c);

int bloom_filter_contains(struct bloom_filter *filter,
			  struct bloom_key *key,
			  struct bloom_filter_settings *settings);

#endif
debug log:

solving 7f40c751f7 ...
found 7f40c751f7 in https://public-inbox.org/git/02b16d94227470059dcee2781e29ae7ae010f602.1580943390.git.gitgitgadget@gmail.com/

applying [1/1] https://public-inbox.org/git/02b16d94227470059dcee2781e29ae7ae010f602.1580943390.git.gitgitgadget@gmail.com/
diff --git a/bloom.h b/bloom.h
new file mode 100644
index 0000000000..7f40c751f7

Checking patch bloom.h...
Applied patch bloom.h cleanly.

index at:
100644 7f40c751f725c647db723e941bf6f66310cd432b	bloom.h

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).