Re: Refactor UnpinBuffer() - Mailing list pgsql-hackers

From Zhang Mingli
Subject Re: Refactor UnpinBuffer()
Date
Msg-id d7f3e13a-fe27-4a91-bd72-969e9401cdaa@Spark
Whole thread Raw
In response to Re: Refactor UnpinBuffer()  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: Refactor UnpinBuffer()
List pgsql-hackers
HI,

On Sep 29, 2022, 05:08 +0800, Nathan Bossart <nathandbossart@gmail.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

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: A potential memory leak on Merge Join when Sort node is not below Materialize node
Next
From: David Rowley
Date:
Subject: Re: A potential memory leak on Merge Join when Sort node is not below Materialize node