From: Sandro Santilli <strk@keybit.net> Date: Thu, 19 Aug 2004 13:56:30 +0000 (+0000) Subject: Added mem_size(lwgeom) X-Git-Tag: pgis_0_9_1~95 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=875d39fbdfe1650c6fdda2309854edded434686b;p=postgis Added mem_size(lwgeom) git-svn-id: http://svn.osgeo.org/postgis/trunk@699 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/lwgeom/lwgeom_functions_basic.c b/lwgeom/lwgeom_functions_basic.c index 10b2dc7a6..82e9293c2 100644 --- a/lwgeom/lwgeom_functions_basic.c +++ b/lwgeom/lwgeom_functions_basic.c @@ -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))); +}