git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3 2/8] Add delta-islands.{c,h}

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Aug 11, 2018, 09:04 UTC
Message-ID
<20180811090418.26674-1-szeder.dev@gmail.com>
In-Reply-To
<20180809155532.26151-3-chriscool@tuxfamily.org>
Show 5 quoted lines
> diff --git a/delta-islands.c b/delta-islands.c
> new file mode 100644
> index 0000000000..448ddcbbe4
> --- /dev/null
> +++ b/delta-islands.c
Show 7 quoted lines
> +static void deduplicate_islands(void)
> +{
> +	struct remote_island *island, *core = NULL, **list;
> +	unsigned int island_count, dst, src, ref, i = 0;
> +
> +	island_count = kh_size(remote_islands);
> +	list = xmalloc(island_count * sizeof(struct remote_island *));
Please use ALLOC_ARRAY here.
Show 27 quoted lines
> +
> +	kh_foreach_value(remote_islands, island, {
> +		list[i++] = island;
> +	});
> +
> +	for (ref = 0; ref + 1 < island_count; ref++) {
> +		for (src = ref + 1, dst = src; src < island_count; src++) {
> +			if (list[ref]->hash == list[src]->hash)
> +				continue;
> +
> +			if (src != dst)
> +				list[dst] = list[src];
> +
> +			dst++;
> +		}
> +		island_count = dst;
> +	}
> +
> +	island_bitmap_size = (island_count / 32) + 1;
> +	core = get_core_island();
> +
> +	for (i = 0; i < island_count; ++i) {
> +		mark_remote_island_1(list[i], core && list[i]->hash == core->hash);
> +	}
> +
> +	free(list);
> +}
Previous: Christian CouderNext: Christian Couder
Message 10 of 14 in “Add delta islands support”
  1. 0/8 Add delta islands supportChristian Couder, Aug 9, 2018
  2. 1/8 packfile: make get_delta_base() non staticChristian Couder, Aug 9, 2018
  3. 3/8 pack-objects: refactor code into compute_layer_order()Christian Couder, Aug 9, 2018
  4. 5/8 repack: add delta-islands supportChristian Couder, Aug 9, 2018
  5. 4/8 pack-objects: add delta-islands supportChristian Couder, Aug 9, 2018
  6. 6/8 t: add t5319-delta-islands.shChristian Couder, Aug 9, 2018
  7. 7/8 pack-objects: move tree_depth into 'struct packing_data'Christian Couder, Aug 9, 2018
  8. 8/8 pack-objects: move 'layer' into 'struct packing_data'Christian Couder, Aug 9, 2018
  9. 2/8 Add delta-islands.{c,h}Christian Couder, Aug 9, 2018
  10. SZEDER GáborAug 11, 2018
  11. Christian CouderAug 11, 2018
  12. Jeff KingAug 11, 2018
  13. Christian CouderAug 12, 2018
  14. Christian CouderAug 9, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.