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

Re: [PATCH v5] mru: Replace mru.[ch] with list.h implementation

From
EWEric Wong <e@80x24.org>
Date
Jan 22, 2018, 07:37 UTC
Message-ID
<20180122073701.h7fh7xrkmnzndzj7@untitled>
In-Reply-To
<1516497964-6041-1-git-send-email-gs051095@gmail.com>
Gargi Sharma <gs051095@gmail.com> wrote:
>  7 files changed, 15 insertions(+), 86 deletions(-)
Thanks! I like the code reduction and increased use of list.h
Were you able to finish running the test suite?  I wasn't :<
Show 10 quoted lines
> -void mru_clear(struct mru *head)
> -{
> -	struct list_head *pos;
> -	struct list_head *tmp;
> -
> -	list_for_each_safe(pos, tmp, &head->list) {
> -		free(list_entry(pos, struct mru, list));
> -	}
> -	INIT_LIST_HEAD(&head->list);
> -}
OK, the free() calls are no longer necessary...
<snip>
Show 7 quoted lines
> --- a/packfile.c
> +++ b/packfile.c
> @@ -859,9 +859,8 @@ static void prepare_packed_git_mru(void)
>  {
>  	struct packed_git *p;
>  
> -	mru_clear(&packed_git_mru);
But the removed mru_clear needs to be replaced with:
+	INIT_LIST_HEAD(&packed_git_mru);
Otherwise, t3050 never finishes for me.
>  	for (p = packed_git; p; p = p->next)
> -		mru_append(&packed_git_mru, p);
> +		list_add_tail(&p->mru, &packed_git_mru);
>  }

Everything else looks good to me, I'm still waiting for the test suite to run but I don't expect further problems.

Previous: Gargi SharmaNext: Jeff King
Message 2 of 3 in “mru: Replace mru.[ch] with list.h implementation”
  1. mru: Replace mru.[ch] with list.h implementationGargi Sharma, Jan 21, 2018
  2. Eric WongJan 22, 2018
  3. Jeff KingJan 23, 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.