[postgis-tickets] r14704 - Expunge all trace of rt_init_allocators

Paul Ramsey pramsey at cleverelephant.ca
Fri Feb 26 03:19:07 PST 2016


Author: pramsey
Date: 2016-02-26 03:19:07 -0800 (Fri, 26 Feb 2016)
New Revision: 14704

Modified:
   trunk/raster/loader/raster2pgsql.c
   trunk/raster/rt_core/librtcore.h
   trunk/raster/rt_core/rt_context.c
   trunk/raster/rt_pg/rtpostgis.c
   trunk/raster/test/cunit/cu_misc.c
   trunk/raster/test/cunit/cu_tester.c
Log:
Expunge all trace of rt_init_allocators


Modified: trunk/raster/loader/raster2pgsql.c
===================================================================
--- trunk/raster/loader/raster2pgsql.c	2016-02-26 11:17:49 UTC (rev 14703)
+++ trunk/raster/loader/raster2pgsql.c	2016-02-26 11:19:07 UTC (rev 14704)
@@ -60,7 +60,8 @@
 	va_end(ap);
 }
 
-void rt_init_allocators(void) {
+static void 
+rt_init_allocators(void) {
 	rt_set_handlers(
 		default_rt_allocator,
 		default_rt_reallocator,

Modified: trunk/raster/rt_core/librtcore.h
===================================================================
--- trunk/raster/rt_core/librtcore.h	2016-02-26 11:17:49 UTC (rev 14703)
+++ trunk/raster/rt_core/librtcore.h	2016-02-26 11:19:07 UTC (rev 14704)
@@ -40,9 +40,8 @@
  * of non-PostGIS applications using rt_core.
  *
  * Programs using this library should set up the default memory managers and error
- * handlers by implementing an rt_init_allocators() function, which can be as
- * a wrapper around the rt_install_default_allocators() function if you want
- * no special handling for memory management and error reporting.
+ * handlers by calling rt_set_handlers() function, or rt_install_default_allocators() 
+ * if you want no special handling for memory management and error reporting.
  *
  **/
 
@@ -245,27 +244,12 @@
 typedef void  (*rt_message_handler)(const char* string, va_list ap)
   __attribute__ (( format(printf,1,0) ));
 
-/****************************************************************************
- * Functions that must be implemented for the raster core function's caller
- * (for example: rt_pg functions, test functions, future loader/exporter)
- ****************************************************************************/
-
-/**
- * Supply the memory management and error handling functions you want your
- * application to use
- */
-extern void rt_init_allocators(void);
-
-/*********************************************************************/
-
-
 /*******************************************************************
  * Functions that may be used by the raster core function's caller
  * (for example: rt_pg functions, test functions, future loader/exporter)
  *******************************************************************/
 /**
  * Apply the default memory management (malloc() and free()) and error handlers.
- * Called inside rt_init_allocators() generally.
  */
 extern void rt_install_default_allocators(void);
 

Modified: trunk/raster/rt_core/rt_context.c
===================================================================
--- trunk/raster/rt_core/rt_context.c	2016-02-26 11:17:49 UTC (rev 14703)
+++ trunk/raster/rt_core/rt_context.c	2016-02-26 11:19:07 UTC (rev 14704)
@@ -126,8 +126,7 @@
 
 
 /**
- * This function is normally called by rt_init_allocators when no special memory
- * management is needed. Useful in raster core testing and in the (future)
+ * Useful in raster core testing and in the (future)
  * loader, when we need to use raster core functions but we don't have
  * PostgreSQL backend behind. We must take care of memory by ourselves in those
  * situations
@@ -145,7 +144,7 @@
 
 
 /**
- * This function is called by rt_init_allocators when the PostgreSQL backend is
+ * This function is called when the PostgreSQL backend is
  * taking care of the memory and we want to use palloc family
  */
 void

Modified: trunk/raster/rt_pg/rtpostgis.c
===================================================================
--- trunk/raster/rt_pg/rtpostgis.c	2016-02-26 11:17:49 UTC (rev 14703)
+++ trunk/raster/rt_pg/rtpostgis.c	2016-02-26 11:19:07 UTC (rev 14704)
@@ -236,15 +236,6 @@
 }
 
 
-void
-rt_init_allocators(void)
-{
-    /* raster callback - install raster handlers */
-    rt_set_handlers(rt_pg_alloc, rt_pg_realloc, rt_pg_free, rt_pg_error,
-            rt_pg_debug, rt_pg_notice);
-}
-
-
 /* ---------------------------------------------------------------- */
 /*  PostGIS raster GUCs                                             */
 /* ---------------------------------------------------------------- */

Modified: trunk/raster/test/cunit/cu_misc.c
===================================================================
--- trunk/raster/test/cunit/cu_misc.c	2016-02-26 11:17:49 UTC (rev 14703)
+++ trunk/raster/test/cunit/cu_misc.c	2016-02-26 11:19:07 UTC (rev 14704)
@@ -115,7 +115,7 @@
 
 	char *disable_all = GDAL_DISABLE_ALL;
 	char *enabled = "GTiff JPEG PNG";
-	char *enabled_vsi = "GTiff JPEG PNG VSICURL";
+	// char *enabled_vsi = "GTiff JPEG PNG VSICURL";
 
 	rt_util_gdal_register_all(1);
 

Modified: trunk/raster/test/cunit/cu_tester.c
===================================================================
--- trunk/raster/test/cunit/cu_tester.c	2016-02-26 11:17:49 UTC (rev 14703)
+++ trunk/raster/test/cunit/cu_tester.c	2016-02-26 11:19:07 UTC (rev 14704)
@@ -72,6 +72,15 @@
 	/* install the custom error handler */
 	lwgeom_set_handlers(0, 0, 0, cu_error_reporter, 0);
 
+	rt_set_handlers(
+		default_rt_allocator,
+		default_rt_reallocator,
+		default_rt_deallocator,
+		cu_error_reporter,
+		default_rt_info_handler,
+		default_rt_warning_handler
+	);
+
 	/* initialize the CUnit test registry */
 	if (CUE_SUCCESS != CU_initialize_registry())
 	{
@@ -240,13 +249,3 @@
 	return band;
 }
 
-void rt_init_allocators(void) {
-	rt_set_handlers(
-		default_rt_allocator,
-		default_rt_reallocator,
-		default_rt_deallocator,
-		cu_error_reporter,
-		default_rt_info_handler,
-		default_rt_warning_handler
-	);
-}



More information about the postgis-tickets mailing list