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

[PATCH] reduce delta head inflated size

From
Nicolas Pitre <nico@cam.org>
Date
Oct 18, 2006, 19:56 UTC
Message-ID
<Pine.LNX.4.64.0610181541280.1971@xanadu.home>

Supposing that both the base and result sizes were both full size 64-bit values, their encoding would occupy only 9.2 bytes each. Therefore inflating 64 bytes is way overkill. Limit it to 20 bytes instead which should be plenty enough for a couple years to come.

Signed-off-by: Nicolas Pitre <nico@cam.org>
---
diff --git a/sha1_file.c b/sha1_file.c
index 25c0bf9..e89d24c 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -943,7 +943,7 @@ static int packed_delta_info(struct pack
 
 	if (sizep) {
 		const unsigned char *data;
-		unsigned char delta_head[64];
+		unsigned char delta_head[20];
 		unsigned long result_size;
 		z_stream stream;
 		int st;
Next: Morten Welinder
Message 1 of 3 in “reduce delta head inflated size”
  1. reduce delta head inflated sizeNicolas Pitre, Oct 18, 2006
  2. Morten WelinderOct 19, 2006
  3. Nicolas PitreOct 19, 2006

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.