]> granicus.if.org Git - postgis/commitdiff
Added comments in estimate_allocation() bugfix point.
authorSandro Santilli <strk@keybit.net>
Thu, 24 Mar 2005 16:27:32 +0000 (16:27 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 24 Mar 2005 16:27:32 +0000 (16:27 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@1561 b70326c6-7e19-0410-871a-916f4a2858ee

lwgeom/lwgeom_estimate.c

index c2dbca8dfba42bed3db537332b8a9d686a7c633b..3bcd5046d8edf56ab783d5e3e89d0dac6bdbe559 100644 (file)
@@ -1296,7 +1296,11 @@ Datum LWGEOM_estimated_extent(PG_FUNCTION_ARGS)
                histo->ymin, histo->xmax, histo->ymax);
 #endif
 
-       /* Construct box2dfloat4 */
+       /*
+        * Construct box2dfloat4.
+        * Must allocate this in upper executor context
+        * to keep it alive after SPI_finish().
+        */
        box = SPI_palloc(sizeof(BOX2DFLOAT4));
 
        box->xmin = histo->xmin;
@@ -2419,7 +2423,11 @@ Datum LWGEOM_estimated_extent(PG_FUNCTION_ARGS)
        elog(NOTICE, " stats array has %d elems", ArrayGetNItems(ARR_NDIM(array), ARR_DIMS(array)));
 #endif
 
-       /* Construct box2dfloat4 */
+       /*
+        * Construct box2dfloat4.
+        * Must allocate this in upper executor context
+        * to keep it alive after SPI_finish().
+        */
        box = SPI_palloc(sizeof(BOX2DFLOAT4));
 
        /* Construct the box */
@@ -2447,6 +2455,9 @@ Datum LWGEOM_estimated_extent(PG_FUNCTION_ARGS)
 
 /**********************************************************************
  * $Log$
+ * Revision 1.28  2005/03/24 16:27:32  strk
+ * Added comments in estimate_allocation() bugfix point.
+ *
  * Revision 1.27  2005/03/24 14:45:50  strk
  * Fixed bug in estimated_extent() returning pointer to a memory allocated in SPI memory context
  *