PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ state_serialize()

bytea * state_serialize ( const UnionState state)
static

Definition at line 192 of file lwgeom_union.c.

193{
194 int32 size = VARHDRSZ + sizeof(state->gridSize) + state->size;
195 bytea *serialized = lwalloc(size);
196 uint8 *data;
197 ListCell *cell;
198
199 SET_VARSIZE(serialized, size);
200 data = (uint8*)VARDATA(serialized);
201
202 /* grid size */
203 memcpy(data, &state->gridSize, sizeof(state->gridSize));
204 data += sizeof(state->gridSize);
205
206 /* items */
207 foreach (cell, state->list)
208 {
209 const GSERIALIZED *gser = (const GSERIALIZED*)lfirst(cell);
210 assert(gser);
211 memcpy(data, gser, VARSIZE(gser));
212 data += VARSIZE(gser);
213 }
214
215 return serialized;
216}
void * lwalloc(size_t size)
Definition lwutil.c:227
unsigned int int32
Definition shpopen.c:54
List * list
float8 gridSize
Definition lwgeom_union.h:9

References UnionState::gridSize, UnionState::list, lwalloc(), and UnionState::size.

Referenced by pgis_geometry_union_parallel_serialfn().

Here is the call graph for this function:
Here is the caller graph for this function: