PostGIS  3.0.6dev-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 175 of file lwcollection.c.

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

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: