Hi, On 2023-02-11 14:25:06 -0800, Andres Freund wrote: > On 2023-01-20 13:40:55 +1300, David Rowley wrote: > > v2-0004: > > > > 5. Is it worth having two versions of PinLocalBuffer() one to adjust > > the usage count and one that does not? Couldn't the version that does > > not adjust the count skip doing pg_atomic_read_u32()? > > I think it'd be nicer to just move the read inside the if > (adjust_usagecount). That way the rest of the function doesn't have to be > duplicated.
Ah, no, we need it for the return value. No current users of PinLocalBuffer(adjust_usagecount = false) need the return value, but I don't think that's necessarily the case. I'm somewhat inclined to not duplicate it, but if you think it's worth it, I'll do that. Greetings, Andres Freund