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

Re: Confused over packfile and index design

From
Shawn Pearce <spearce@spearce.org>
Date
Apr 9, 2011, 14:45 UTC
Message-ID
<BANLkTin8SXWC2cUqYvrPJrQWQKgMpRk4bg@mail.gmail.com>
In-Reply-To
<m28vvj7b0d.fsf@Spindle.sehlabs.com>
On Sat, Apr 9, 2011 at 10:30, Steven E. Harris <seh@panix.com> wrote:
Show 7 quoted lines
> Shawn Pearce <spearce@spearce.org> writes:
>> Its meant to tell us how many bytes to malloc() in order to hold the
>> result of the libz inflate() call when the object is being read from
>> the packfile. That way we don't under or over allocate the result
>> buffer.
>
> Does Git always inflate the objects into an in-memory buffer?
Yes.
> As the
> size of these objects can be very large (given the variable-length size
> encoding), is there any provision to inflate the object to a temporary
> file?

Not currently. If you don't have enough memory for the malloc() buffer of a big object, Git dies with an out of memory error.

-- 
Shawn.
Previous: Steven E. HarrisNext: Nicolas Pitre
Message 5 of 7 in “Confused over packfile and index design”
  1. Steven E. HarrisApr 8, 2011
  2. Jeff KingApr 9, 2011
  3. Shawn PearceApr 9, 2011
  4. Steven E. HarrisApr 9, 2011
  5. Shawn PearceApr 9, 2011
  6. Nicolas PitreApr 10, 2011
  7. Steven E. HarrisApr 10, 2011

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.