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

Re: [PATCH] builtin/rm.c: Use ALLOG_GROW instead of alloc_nr and xrealloc.

From
Thiago Farina <tfransosi@gmail.com>
Date
Dec 14, 2010, 01:56 UTC
Message-ID
<AANLkTim7yC9ZZHBQFtRYeyABn7=BTfAdgwd6-aJhNd0c@mail.gmail.com>
In-Reply-To
<a09428c75202974dc69b613ae3c2096d82e5a0ca.1292290546.git.tfransosi@gmail.com>
On Mon, Dec 13, 2010 at 11:37 PM, Thiago Farina <tfransosi@gmail.com> wrote:
Show 21 quoted lines
> Signed-off-by: Thiago Farina <tfransosi@gmail.com>
> ---
>  builtin/rm.c |    5 +----
>  1 files changed, 1 insertions(+), 4 deletions(-)
>
> diff --git a/builtin/rm.c b/builtin/rm.c
> index c7b7bb3..faeedfc 100644
> --- a/builtin/rm.c
> +++ b/builtin/rm.c
> @@ -22,10 +22,7 @@ static struct {
>
>  static void add_list(const char *name)
>  {
> -       if (list.nr >= list.alloc) {
> -               list.alloc = alloc_nr(list.alloc);
> -               list.name = xrealloc(list.name, list.alloc * sizeof(const char *));
> -       }
> +       ALLOC_GROW(list.name, list.nr + 1, list.alloc);
>        list.name[list.nr++] = name;
>  }
>

Disregard this, as I made a typo in the subject. Sent another patch with the subject typo fixed. Thanks.

Previous: Thiago Farina
Message 2 of 2 in “builtin/rm.c: Use ALLOG_GROW instead of alloc_nr and xrealloc.”
  1. builtin/rm.c: Use ALLOG_GROW instead of alloc_nr and xrealloc.Thiago Farina, Dec 14, 2010
  2. Thiago FarinaDec 14, 2010

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.