Skip to content

Commit

Permalink
Remove pglwgeom_size
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/postgis/trunk@8045 b70326c6-7e19-0410-871a-916f4a2858ee
  • Loading branch information
pramsey committed Oct 29, 2011
1 parent 475ce68 commit 9899cf8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
5 changes: 0 additions & 5 deletions libpgcommon/lwgeom_pg.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,6 @@ pglwgeom_serialize(LWGEOM *in)
return gser;
}

size_t pglwgeom_size(const GSERIALIZED *geom)
{
return VARSIZE(geom) - VARHDRSZ;
};

int pglwgeom_ndims(const GSERIALIZED *geom)
{
return FLAGS_NDIMS(geom->flags);
Expand Down
2 changes: 0 additions & 2 deletions libpgcommon/lwgeom_pg.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ GSERIALIZED* gserialized_drop_gidx(GSERIALIZED *g);
extern GSERIALIZED *pglwgeom_serialize(LWGEOM *lwgeom);


/* GSERIALIZED SRID get/set */
extern size_t pglwgeom_size(const GSERIALIZED *geom);
extern int pglwgeom_ndims(const GSERIALIZED *geom);
/*
* Get the 2d bounding box of the given geometry, in FLOAT4 format.
Expand Down
11 changes: 1 addition & 10 deletions postgis/lwgeom_functions_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,7 @@ PG_FUNCTION_INFO_V1(LWGEOM_mem_size);
Datum LWGEOM_mem_size(PG_FUNCTION_ARGS)
{
GSERIALIZED *geom = (GSERIALIZED *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
size_t size = VARSIZE(geom);
size_t computed_size = pglwgeom_size(geom);
computed_size += VARHDRSZ; /* varlena size */
if ( size != computed_size )
{
elog(NOTICE, "varlena size (%lu) != computed size+4 (%lu)",
(unsigned long)size,
(unsigned long)computed_size);
}

size_t size = VARSIZE(geom) - VARHDRSZ;
PG_FREE_IF_COPY(geom,0);
PG_RETURN_INT32(size);
}
Expand Down

0 comments on commit 9899cf8

Please sign in to comment.