Subject: Re: [PATCH v2 12/14] commit-graph: add large-filters bitmap chunk

From: Junio C Hamano <[email-masked]>
Date: Wed, 05 Aug 2020 14:01:29 -0700

Taylor Blau <[email-masked]> writes:

> @@ -71,6 +72,10 @@ struct commit_graph {
>  	const unsigned char *chunk_base_graphs;
>  	const unsigned char *chunk_bloom_indexes;
>  	const unsigned char *chunk_bloom_data;
> +	const unsigned char *chunk_bloom_large_filters;
> +
> +	size_t bloom_large_to_alloc;
> +	struct bitmap bloom_large;

Hmph, is the API rich enough to allow users to release the resource
used by such an embedded bitmap?  I ask becuase...

> @@ -2503,6 +2577,7 @@ void free_commit_graph(struct commit_graph *g)
>  	}
>  	free(g->filename);
>  	free(g->bloom_filter_settings);
> +	bitmap_free(g->bloom_large);
>  	free(g);
>  }

... this hunk cannot be possibly correct as-is, and cannot be made
correct without changing g->bloom_large to a pointer into a heap
allocated bitmap, because bitmap_free() wants to not just release
the resource held by the bitmap but the bitmap itself.