From 9fe541bbce89b6359e3bad8578d176e941b96572 Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Wed, 27 Dec 2017 15:23:29 +0000 Subject: [PATCH] Change new cache behavior to require > 9.6 instead of > 9.5, the AllocSetContextCreate structure in 9.5 doesn't support ALLOCSET_SMALL_SIZES macro so would otherwise require more ugly ifdefing. Closes #3950 git-svn-id: http://svn.osgeo.org/postgis/trunk@16189 b70326c6-7e19-0410-871a-916f4a2858ee --- extensions/address_standardizer/std_pg_hash.c | 8 ++++---- libpgcommon/lwgeom_transform.c | 8 ++++---- postgis/lwgeom_geos_prepared.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/extensions/address_standardizer/std_pg_hash.c b/extensions/address_standardizer/std_pg_hash.c index ffd55d2f3..082d52ae7 100644 --- a/extensions/address_standardizer/std_pg_hash.c +++ b/extensions/address_standardizer/std_pg_hash.c @@ -113,7 +113,7 @@ static int load_rules(RULES *rules, char *tabname); static void -#if POSTGIS_PGSQL_VERSION < 95 +#if POSTGIS_PGSQL_VERSION < 96 StdCacheDelete(MemoryContext context) { @@ -140,7 +140,7 @@ StdCacheDelete(void *ptr) DeleteStdHashEntry(context); } -#if POSTGIS_PGSQL_VERSION < 95 +#if POSTGIS_PGSQL_VERSION < 96 static void StdCacheInit(MemoryContext context) @@ -194,7 +194,7 @@ static MemoryContextMethods StdCacheContextMethods = #endif }; -#endif /* POSTGIS_PGSQL_VERSION < 95 */ +#endif /* POSTGIS_PGSQL_VERSION < 96 */ uint32 @@ -383,7 +383,7 @@ AddToStdPortalCache(StdPortalCache *STDCache, char *lextab, char *gaztab, char * DBG("Adding item to STD cache ('%s', '%s', '%s') index %d", lextab, gaztab, rultab, STDCache->NextSlot); -#if POSTGIS_PGSQL_VERSION < 95 +#if POSTGIS_PGSQL_VERSION < 96 STDMemoryContext = MemoryContextCreate(T_AllocSetContext, 8192, &StdCacheContextMethods, STDCache->StdCacheContext, diff --git a/libpgcommon/lwgeom_transform.c b/libpgcommon/lwgeom_transform.c index 1993326f0..8d9768eaa 100644 --- a/libpgcommon/lwgeom_transform.c +++ b/libpgcommon/lwgeom_transform.c @@ -89,7 +89,7 @@ void SetPROJ4LibPath(void); static void -#if POSTGIS_PGSQL_VERSION < 95 +#if POSTGIS_PGSQL_VERSION < 96 PROJ4SRSCacheDelete(MemoryContext context) { #else @@ -113,7 +113,7 @@ PROJ4SRSCacheDelete(void *ptr) DeletePJHashEntry(context); } -#if POSTGIS_PGSQL_VERSION < 95 +#if POSTGIS_PGSQL_VERSION < 96 static void PROJ4SRSCacheInit(MemoryContext context) @@ -182,7 +182,7 @@ static MemoryContextMethods PROJ4SRSCacheContextMethods = #endif }; -#endif /* POSTGIS_PGSQL_VERSION < 95 */ +#endif /* POSTGIS_PGSQL_VERSION < 96 */ /* * PROJ4 projPJ Hash Table functions @@ -534,7 +534,7 @@ AddToPROJ4SRSCache(PROJ4PortalCache *PROJ4Cache, int srid, int other_srid) */ POSTGIS_DEBUGF(3, "adding SRID %d with proj4text \"%s\" to query cache at index %d", srid, proj_str, PROJ4Cache->PROJ4SRSCacheCount); -#if POSTGIS_PGSQL_VERSION < 95 +#if POSTGIS_PGSQL_VERSION < 96 PJMemoryContext = MemoryContextCreate(T_AllocSetContext, 8192, &PROJ4SRSCacheContextMethods, PROJ4Cache->PROJ4SRSCacheContext, diff --git a/postgis/lwgeom_geos_prepared.c b/postgis/lwgeom_geos_prepared.c index 50e85636b..ea453e1fa 100644 --- a/postgis/lwgeom_geos_prepared.c +++ b/postgis/lwgeom_geos_prepared.c @@ -96,7 +96,7 @@ static void DeletePrepGeomHashEntry(MemoryContext mcxt); static void -#if POSTGIS_PGSQL_VERSION < 95 +#if POSTGIS_PGSQL_VERSION < 96 PreparedCacheDelete(MemoryContext context) { #else @@ -125,7 +125,7 @@ PreparedCacheDelete(void *ptr) DeletePrepGeomHashEntry(context); } -#if POSTGIS_PGSQL_VERSION < 95 +#if POSTGIS_PGSQL_VERSION < 96 static void PreparedCacheInit(MemoryContext context) { @@ -192,7 +192,7 @@ static MemoryContextMethods PreparedCacheContextMethods = #endif }; -#endif /* POSTGIS_PGSQL_VERSION < 95 */ +#endif /* POSTGIS_PGSQL_VERSION < 96 */ @@ -313,7 +313,7 @@ PrepGeomCacheBuilder(const LWGEOM *lwgeom, GeomCache *cache) if ( ! prepcache->context_callback ) { PrepGeomHashEntry pghe; -#if POSTGIS_PGSQL_VERSION < 95 +#if POSTGIS_PGSQL_VERSION < 96 prepcache->context_callback = MemoryContextCreate(T_AllocSetContext, 8192, &PreparedCacheContextMethods, prepcache->context_statement, -- 2.40.0