Re: Removed extra memory allocations from create_list_bounds

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Nitin Jadhav <nitinjadhavpostgres(at)gmail(dot)com>, Zhihong Yu <zyu(at)yugabyte(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Removed extra memory allocations from create_list_bounds
Date: 2021-07-06 00:27:29
Message-ID: CAApHDvojW2g_oXGTjGUtf9kBFGuxr8rxB+WvzGhZK0C-vLJkhQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 6 Jul 2021 at 05:03, Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:
>
> Also, if you're going to remove the initializations here, maybe you'd also
> change i and j to C99 "for" declarations like "for (int i=0, j=0; ...)"
>
> - PartitionListValue **all_values = NULL;
> - ListCell *cell;
> - int i = 0;
> - int ndatums = 0;
> + PartitionListValue *all_values;
> + int i;
> + int j;
> + int ndatums;
>
> Same in get_non_null_list_datum_count()

I tend to only get motivated to use that for new code that does not
exist in back-branches. I'll maybe stop doing that when we no longer
have to support the pre-C99 versions of the code.

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2021-07-06 00:40:02 Re: Minor typo in generate_useful_gather_paths comment
Previous Message David Rowley 2021-07-06 00:26:19 Re: Removed extra memory allocations from create_list_bounds