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

Re: [OUTREACHY] pack: make packed_git_mru global a value instead of a pointer

From
Jeff King <peff@peff.net>
Date
Sep 19, 2017, 05:20 UTC
Message-ID
<20170919052017.mcspwuse3vlobpxf@sigill.intra.peff.net>
In-Reply-To
<20170918231724.GY27425@aiede.mtv.corp.google.com>
On Mon, Sep 18, 2017 at 04:17:24PM -0700, Jonathan Nieder wrote:
Show 30 quoted lines
> phionah bugosi wrote:
> 
> > Just to reecho a previous change requested before in one of the mail
> > threads, we currently have two global variables declared:
> >
> > struct mru packed_git_mru_storage;
> > struct mru *packed_git_mru = &packed_git_mru_storage;
> >
> > We normally use pointers in C to point or refer to the same location
> > or space in memory from multiple places. That means in situations
> > where we will have the pointer be assigned to in many places in our
> > code. But in this case, we do not have any other logic refering or
> > assigning to the pointer packed_git_mru. In simple words we actually
> > dont need a pointer in this case.
> >
> > Therefore this patch makes packed_git_mru global a value instead of
> > a pointer and makes use of list.h
> >
> > Signed-off-by: phionah bugosi <bugosip@gmail.com>
> > ---
> >  builtin/pack-objects.c |  5 +++--
> >  cache.h                |  7 -------
> >  list.h                 |  6 ++++++
> >  packfile.c             | 12 ++++++------
> >  4 files changed, 15 insertions(+), 15 deletions(-)
> 
> *puzzled* This appears to already be in "pu", with a different author.
> Did you independently make the same change?  Or are you asking for a
> progress report on that change, and just phrasing it in a confusing
> way?
I pointed Phionah at your #leftoverbits comment in:
  https://public-inbox.org/git/20170912172839.GB144745@aiede.mtv.corp.google.com/

about moving packed_git_mru to list.h. But I'm afraid I wasn't very clear in giving further guidance.

The goal is to build on _top_ of the patch in that message, and convert the doubly-linked list implementation used in "struct mru" to use the shared code in list.h. That should mostly involve touching mru.c and mru.h, though I think we'd need to tweak the name of the "next" pointer during the traversal, too.

-Peff
Previous: Jonathan Nieder
Message 3 of 3 in “[OUTREACHY] pack: make packed_git_mru global a value instead of a pointer”
  1. phionah bugosiSep 18, 2017
  2. Jonathan NiederSep 18, 2017
  3. Jeff KingSep 19, 2017

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.