Taylor Blau <me@xxxxxxxxxxxx> writes: > In subsequent commits, we will want to load existing Bloom filters out > of a commit-graph, even when the hash version they were computed with > does not match the value of `commitGraph.changedPathVersion`. > > In order to differentiate between the two, add a "filter" field to each > Bloom filter. You mean "version", I think. > @@ -55,6 +55,7 @@ struct bloom_filter_settings { > struct bloom_filter { > unsigned char *data; > size_t len; > + int version; > }; We might want to shrink the sizes of len (we have a changed path limit so we know exactly how big Bloom filters can get) and version so that this struct doesn't take up more space. But if other reviewers think that this is OK, I'm fine with that. Another thing that we might want to track is whether the Bloom filter is a reference to an existing buffer (and thus does not need to be freed) or a reference to a malloc-ed buffer that we must free. But both before and after this patch set, a malloc-ed buffer is never overridden by a reference-to-existing-buffer, so we should still be fine for now. (This patch set does add a scenario in which a reference-to-existing buffer is overridden by a malloc-ed buffer, but that's the only new scenario.)