]> granicus.if.org Git - postgis/commitdiff
Expunge all trace of rt_init_allocators
authorPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 26 Feb 2016 11:19:07 +0000 (11:19 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 26 Feb 2016 11:19:07 +0000 (11:19 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@14704 b70326c6-7e19-0410-871a-916f4a2858ee

raster/loader/raster2pgsql.c
raster/rt_core/librtcore.h
raster/rt_core/rt_context.c
raster/rt_pg/rtpostgis.c
raster/test/cunit/cu_misc.c
raster/test/cunit/cu_tester.c

index da3b35b1f9585dd1ff7e02c5f1faa1d7db3748a8..2d7828b0335964d4038155c57bc31f38418d0618 100644 (file)
@@ -60,7 +60,8 @@ loader_rt_info_handler(const char *fmt, va_list ap) {
        va_end(ap);
 }
 
-void rt_init_allocators(void) {
+static void 
+rt_init_allocators(void) {
        rt_set_handlers(
                default_rt_allocator,
                default_rt_reallocator,
index 52bc829b398ec480c86967674290e34cb011eed2..2001a9238507277eab6303a4032d26cabfcd76e1 100644 (file)
@@ -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_deallocator)(void *mem);
 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);
 
index 104d3021e6913da8e18675790bb393d901cda999..dce892b4ebdf7804773ae44044f2835d896f65d3 100644 (file)
@@ -126,8 +126,7 @@ static struct rt_context_t ctx_t = {
 
 
 /**
- * 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 @@ rt_install_default_allocators(void)
 
 
 /**
- * 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
index ffad1e1aa548a467c8cd17274823e710464f3f56..c506b82fde98f7dba4921dcb2d25d2127b7bd2e8 100644 (file)
@@ -236,15 +236,6 @@ rt_pg_debug(const char *fmt, va_list ap)
 }
 
 
-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                                             */
 /* ---------------------------------------------------------------- */
index 55790729decc54907cbb273f78222df39a8052ea..0616e2645fdffbe7a4461f909ab4087497741517 100644 (file)
@@ -115,7 +115,7 @@ static void test_util_gdal_open() {
 
        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);
 
index 670b5150ef89a5d2f28fede716f17af2ef65a711..d50c4b39cc26b724ce5851b44c79f6057054618e 100644 (file)
@@ -72,6 +72,15 @@ int main(int argc, char *argv[])
        /* 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 @@ rt_band cu_add_band(rt_raster raster, rt_pixtype pixtype, int hasnodata, double
        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
-       );
-}