Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)
Date
Msg-id CAAKRu_bHpHthLdBrvLGhJsTLLe6zkPk5Q9pnBLrOdObUBZiwDg@mail.gmail.com
Whole thread Raw
In response to Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)  (Peter Eisentraut <peter@eisentraut.org>)
List pgsql-hackers
On Tue, Dec 16, 2025 at 7:18 AM Peter Eisentraut <peter@eisentraut.org> wrote:
>
> You are not modifying deadoffsets in prune_freeze_setup(), but you are
> assigning its address to a pointer variable that is not const-qualified,
> and so it could be used to modify it later on.
>
> A caller to prune_freeze_setup() that sees the signature const
> PruneFreezeResult *presult could pass a pointer to a PruneFreezeResult
> object that is notionally in read-only memory.  But through the
> non-const-qualified pointer you could later modify the pointed-to
> memory, which would be invalid.  The point of propagating the qualifiers
> is to prevent that at compile time.

Thanks for the explanation. I've committed your proposed fix.

- Melanie



pgsql-hackers by date:

Previous
From: Melanie Plageman
Date:
Subject: Re: Fix uninitialized PruneFreezeResult in pruneheap and vacuumlazy
Next
From: Andres Freund
Date:
Subject: Re: Replace is_publishable_class() with relispublishable column in pg_class