From: Sandro Santilli Date: Fri, 20 Aug 2004 09:31:32 +0000 (+0000) Subject: bug fixed in lwgeom_mem_size X-Git-Tag: pgis_0_9_1~88 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8bf9b37d4aca0fb970283a3f917e3c15fb2f499b;p=postgis bug fixed in lwgeom_mem_size git-svn-id: http://svn.osgeo.org/postgis/trunk@706 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/lwgeom/lwgeom_functions_basic.c b/lwgeom/lwgeom_functions_basic.c index 8c2efa5c1..e8e7f650e 100644 --- a/lwgeom/lwgeom_functions_basic.c +++ b/lwgeom/lwgeom_functions_basic.c @@ -193,7 +193,9 @@ Datum combine_box2d(PG_FUNCTION_ARGS) 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))); + char *geom = (char *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0)); + int size = *((int *)geom); + PG_FREE_IF_COPY(geom,0); + int32 vlsize = VARSIZE(PG_GETARG_POINTER(0)); + PG_RETURN_INT32(size); }