pgsql: Remove MemoryContextContains().

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove MemoryContextContains().
Date: 2022-10-06 17:35:38
Message-ID: E1ogUmX-001Boq-Gi@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Remove MemoryContextContains().

MemoryContextContains is no longer reliable in the wake of c6e0fe1f2,
because there's no longer very much redundancy in chunk headers.
(It wasn't *completely* reliable even before that, as there was a
chance of a false positive if you passed it something that didn't
point to an mcxt chunk at all. But it was generally good enough.)

Hence, remove it. There is no remaining core code that requires it.
Extensions that have been using it might be able to substitute a
test like "GetMemoryChunkContext(ptr) == context", recognizing that
this explicitly requires that the pointer point to some chunk.

Tom Lane and David Rowley

Discussion: https://postgr.es/m/1913788.1664898906@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9543eff5e015b6f6f832da2d95d659629a2022f3

Modified Files
--------------
src/backend/utils/mmgr/mcxt.c | 58 ++-----------------------------------------
src/include/utils/memutils.h | 1 -
2 files changed, 2 insertions(+), 57 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2022-10-06 20:10:35 pgsql: windows: Adjust FD_SETSIZE via commandline define
Previous Message Alvaro Herrera 2022-10-06 16:28:36 Re: pgsql: Avoid improbable PANIC during heap_update.