Re: refactor ExecGrant_*() functions

From: Antonin Houska <ah(at)cybertec(dot)at>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: refactor ExecGrant_*() functions
Date: 2022-12-13 15:03:57
Message-ID: 3239.1670943837@antos
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com> wrote:

> On 12.12.22 10:44, Antonin Houska wrote:
> > Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com> wrote:
> >
> >> On 06.12.22 09:41, Antonin Houska wrote:
> >>> Attached are my proposals for improvements. One is to avoid memory leak, the
> >>> other tries to improve readability a little bit.
> >>
> >> I added the readability improvement to my v2 patch. The pfree() calls aren't
> >> necessary AFAICT.
>
> It's something to consider, but since this is a refactoring patch and the old
> code didn't do it either, I think it's out of scope.

Well, the reason I brought this topic up is that the old code didn't even
palloc() those arrays. (Because the were located in the stack.)

> > I see that memory contexts exist and that the amount of memory freed is not
> > huge, but my style is to free the memory explicitly if it's allocated in a
> > loop.
> > v2 looks good to me.
>
> Committed, thanks.

ok, I'll post rebased "USAGE privilege on PUBLICATION" patch [1] soon.

--
Antonin Houska
Web: https://www.cybertec-postgresql.com

[1] https://commitfest.postgresql.org/41/3641/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-12-13 15:13:34 Re: Ordering behavior for aggregates
Previous Message Greg Stark 2022-12-13 14:22:37 Re: Temporary tables versus wraparound... again