Re: Refactor UnpinBuffer()

From: Zhang Mingli <zmlpostgres(at)gmail(dot)com>
To: Aleksander Alekseev <aleksander(at)timescale(dot)com>, Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Refactor UnpinBuffer()
Date: 2022-09-29 01:05:18
Message-ID: d7f3e13a-fe27-4a91-bd72-969e9401cdaa@Spark
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

HI,

On Sep 29, 2022, 05:08 +0800, Nathan Bossart <nathandbossart(at)gmail(dot)com>, wrote:
> On Wed, Sep 28, 2022 at 08:14:23PM +0300, Aleksander Alekseev wrote:
> > + ResourceOwnerForgetBuffer(CurrentResourceOwner, b);
> > +
> > /* not moving as we're likely deleting it soon anyway */
> > ref = GetPrivateRefCountEntry(b, false);
> > Assert(ref != NULL);
> > -
> > - if (fixOwner)
> > - ResourceOwnerForgetBuffer(CurrentResourceOwner, b);
+1, Good catch.
>
> Is it safe to move the call to ResourceOwnerForgetBuffer() to before the
> call to GetPrivateRefCountEntry()? From my quick skim of the code, it
> seems like it should be safe, but I thought I'd ask the question.
Same question, have a look, it doesn’t seem to matter.

Regards,
Zhang Mingli

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2022-09-29 01:12:44 Re: A potential memory leak on Merge Join when Sort node is not below Materialize node
Previous Message Michael Paquier 2022-09-28 23:57:52 Re: A potential memory leak on Merge Join when Sort node is not below Materialize node