PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ gserialized_copy()

GSERIALIZED* gserialized_copy ( const GSERIALIZED g)

Return a copy of the input serialized geometry.

Definition at line 116 of file g_serialized.c.

References gserialized_is_empty_recurse(), lwalloc(), GSERIALIZED::size, and SIZE_GET.

117 {
118  GSERIALIZED *g_out = NULL;
119  assert(g);
120  g_out = (GSERIALIZED*)lwalloc(SIZE_GET(g->size));
121  memcpy((uint8_t*)g_out,(uint8_t*)g,SIZE_GET(g->size));
122  return g_out;
123 }
#define SIZE_GET(varsize)
Macro for reading the size from the GSERIALIZED size attribute.
uint32_t size
Definition: liblwgeom.h:380
void * lwalloc(size_t size)
Definition: lwutil.c:227
Here is the call graph for this function: