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

Re: [PATCH] Make object contents optionally available

From
Linus Torvalds <torvalds@osdl.org>
Date
May 17, 2005, 15:29 UTC
Message-ID
<Pine.LNX.4.58.0505170826061.18337@ppc970.osdl.org>
In-Reply-To
<Pine.LNX.4.21.0505170049480.30848-100000@iabervon.org>
On Tue, 17 May 2005, Daniel Barkalow wrote:
Show 7 quoted lines
>
> This adds contents and size fields to struct object. If unpack_object is
> called on an object, it will fill in the contents field with the complete
> raw contents of the object. If free_object_contents is called on an
> object, the contents will be freed. If contents is filled when an object
> is parsed, it is not unpacked an extra time, but the contents are not
> retained if they were not unpacked before parsing.

I really hate magic interfaces like that. It's just a bug waiting to happen.

I'd actually prefer it if "parse_object()" just always unpacks it, and leaves the unpacked thing in memory.

Then, the _few_ programs that really care about memory use because they parse potentially millions of objects (especially blobs, which obviously can be very large) can be updated to just do a manual "free_object_contents()". That's primarily things like fsck and convert-cache, I suspect.

That would leave a lot less special cases and strange rules..
		Linus
Previous: Daniel BarkalowNext: Daniel Barkalow
Message 2 of 7 in “Make object contents optionally available”
  1. Make object contents optionally availableDaniel Barkalow, May 17, 2005
  2. Linus TorvaldsMay 17, 2005
  3. Daniel BarkalowMay 17, 2005
  4. Junio C HamanoMay 17, 2005
  5. Daniel BarkalowMay 17, 2005
  6. Junio C HamanoMay 17, 2005
  7. Daniel BarkalowMay 17, 2005

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.