PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwcollection_reserve()

void lwcollection_reserve ( LWCOLLECTION col,
uint32_t  ngeoms 
)

Ensure the collection can hold at least up to ngeoms geometries.

Ensure the collection can hold at least up to ngeoms geometries.

Definition at line 174 of file lwcollection.c.

175 {
176  if ( ngeoms <= col->maxgeoms ) return;
177 
178  /* Allocate more space if we need it */
179  do { col->maxgeoms *= 2; } while ( col->maxgeoms < ngeoms );
180  col->geoms = lwrealloc(col->geoms, sizeof(LWGEOM*) * col->maxgeoms);
181 }
void * lwrealloc(void *mem, size_t size)
Definition: lwutil.c:237
uint32_t maxgeoms
Definition: liblwgeom.h:511
LWGEOM ** geoms
Definition: liblwgeom.h:512

References LWCOLLECTION::geoms, lwrealloc(), and LWCOLLECTION::maxgeoms.

Referenced by lwcollection_add_lwgeom(), and lwgeom_node().

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