Re: Weird usages of sentinel_ok()

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Weird usages of sentinel_ok()
Date: 2026-10-16 03:00:12
Message-ID: CAGRkXqQxTCthDEnw_10OEGLVNMUeyE4So-K29jmn9nAkxtr1ow@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi David,

The patch looks right to me. All three CHUNKHDRSZ macros are
sizeof(MemoryChunk), so the checked byte is the same.

While looking at the other callers I noticed bump.c sets the sentinel
and requested_size in BumpAllocLarge() and BumpAllocChunkFromBlock(),
but nothing ever reads them. Bump has no pfree, so BumpCheck() is the
only place that could check it, and it doesn't. Is that on purpose, or
should BumpCheck() call sentinel_ok() like the others do?

Thanks,
Shihao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message 杨伯宇 (长堂) 2026-10-16 03:01:59 Re:logical decoding: skip unnecessary snapshot distribution.
Previous Message Chao Li 2026-10-16 02:39:29 Re: Fix numeric log() with an infinite value and 0<base<=1