Re: benign bug in BufFileLoadBuffer / incorrect sizeof

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Tomas Vondra <tomas(at)vondra(dot)me>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: benign bug in BufFileLoadBuffer / incorrect sizeof
Date: 2025-01-12 19:16:27
Message-ID: 6847F153-2700-4B22-9068-901D37CD5D2F@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 12 Jan 2025, at 17:10, Tomas Vondra <tomas(at)vondra(dot)me> wrote:
>
> Hi,
>
> While experimenting with some changes in BufFile, I noticed a harmless
> bug in BufFileLoadBuffer. It calls sizeof on the whole PGAlignedBuffer,
> instead of just on the "data" field. It's benign because the "data" is
> the largest part of the union, so the sizes are equal.
>
> But it's still confusing, it took me a while my experimental patch
> fails. So I think it'd be good to correct it.

Nice catch, patch LGTM.

--
Daniel Gustafsson

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-01-12 19:21:07 Re: pgsql: Consolidate docs for vacuum-related GUCs in new subsection
Previous Message Daniel Gustafsson 2025-01-12 19:07:21 Re: pgsql: Consolidate docs for vacuum-related GUCs in new subsection