]> granicus.if.org Git - postgis/commitdiff
Added mem_size(lwgeom)
authorSandro Santilli <strk@keybit.net>
Thu, 19 Aug 2004 13:56:30 +0000 (13:56 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 19 Aug 2004 13:56:30 +0000 (13:56 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@699 b70326c6-7e19-0410-871a-916f4a2858ee

lwgeom/lwgeom_functions_basic.c

index 10b2dc7a686ff94d1c807c1db00cc875bd846ff4..82e9293c278f0075addb68cb447e0ae489137ac5 100644 (file)
@@ -189,3 +189,12 @@ Datum combine_box2d(PG_FUNCTION_ARGS)
 
        PG_RETURN_POINTER(result);
 }
+
+//find the size of geometry
+PG_FUNCTION_INFO_V1(lwgeom_mem_size);
+Datum lwgeom_mem_size(PG_FUNCTION_ARGS)
+{
+       //char *geom = (char *)  PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
+       //struct varlena *vl = (struct varlena *)(PG_GETARG_POINTER(0));
+       PG_RETURN_INT32(VARSIZE(PG_GETARG_POINTER(0)));
+}