benign bug in BufFileLoadBuffer / incorrect sizeof

Tomas Vondra <tomas@vondra.me>

From: Tomas Vondra <tomas@vondra.me>
To: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-01-12T16:10:19Z
Lists: pgsql-hackers

Attachments

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.

regards

-- 
Tomas Vondra

Commits

  1. Use the correct sizeof() in BufFileLoadBuffer