[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-169-gb49f566ad

git at osgeo.org git at osgeo.org
Mon Oct 10 20:28:29 PDT 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  b49f566adc39eec98f43a80e5cfe6f51c795169c (commit)
      from  c7c8f05d8f397cc92b9f61c76eb19c13939fc1fa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b49f566adc39eec98f43a80e5cfe6f51c795169c
Author: Regina Obe <lr at pcorp.us>
Date:   Mon Oct 10 23:27:27 2022 -0400

    Remove MemoryContextContains use for PG16
    Closes #5257 for PostGIS 3.4.0

diff --git a/NEWS b/NEWS
index 1c2ff5c97..c1a1d6114 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ xxxx/xx/xx
 
 * New Features *
   - New install-extension-upgrades command in postgis script (Sandro Santilli)
+  - #5257, Remove MemoryContextContains use for PG16 (Regina Obe)
 
 * Enhancements *
   - #5194, do not update system catalogs from postgis_extensions_upgrade (Sandro Santilli)
diff --git a/libpgcommon/shared_gserialized.c b/libpgcommon/shared_gserialized.c
index 4b088a966..8513c5a70 100644
--- a/libpgcommon/shared_gserialized.c
+++ b/libpgcommon/shared_gserialized.c
@@ -47,7 +47,12 @@ shared_gserialized_new_cached(FunctionCallInfo fcinfo, Datum d)
 SHARED_GSERIALIZED *
 shared_gserialized_ref(FunctionCallInfo fcinfo, SHARED_GSERIALIZED *ref)
 {
+#if POSTGIS_PGSQL_VERSION >= 160
+/** MemoryContextContains was removed in PG16 **/
+	if ( PostgisCacheContext(fcinfo) == GetMemoryChunkContext(ref) )
+#else
 	if (MemoryContextContains(PostgisCacheContext(fcinfo), ref))
+#endif
 	{
 		ref->count++;
 		return ref;
@@ -65,7 +70,12 @@ shared_gserialized_ref(FunctionCallInfo fcinfo, SHARED_GSERIALIZED *ref)
 void
 shared_gserialized_unref(FunctionCallInfo fcinfo, SHARED_GSERIALIZED *ref)
 {
+#if POSTGIS_PGSQL_VERSION >= 160
+/** MemoryContextContains was removed in PG16 **/
+	if ( PostgisCacheContext(fcinfo) == GetMemoryChunkContext(ref) )
+#else
 	if (MemoryContextContains(PostgisCacheContext(fcinfo), ref))
+#endif
 	{
 		ref->count--;
 		if (!ref->count)
@@ -95,4 +105,4 @@ const GSERIALIZED *
 shared_gserialized_get(SHARED_GSERIALIZED *s)
 {
 	return s->geom;
-}
\ No newline at end of file
+}

-----------------------------------------------------------------------

Summary of changes:
 NEWS                             |  1 +
 libpgcommon/shared_gserialized.c | 12 +++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list