PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ AddPrepGeomHashEntry()

static void AddPrepGeomHashEntry ( PrepGeomHashEntry  pghe)
static

Definition at line 233 of file lwgeom_geos_prepared.c.

References PrepGeomHashEntry::context, PrepGeomHashEntry::geom, PrepGeomHashEntry::prepared_geom, and PrepGeomHash.

Referenced by PrepGeomCacheBuilder().

234 {
235  bool found;
236  void **key;
237  PrepGeomHashEntry *he;
238 
239  /* The hash key is the MemoryContext pointer */
240  key = (void *)&(pghe.context);
241 
242  he = (PrepGeomHashEntry *) hash_search(PrepGeomHash, key, HASH_ENTER, &found);
243  if (!found)
244  {
245  /* Insert the entry into the new hash element */
246  he->context = pghe.context;
247  he->geom = pghe.geom;
248  he->prepared_geom = pghe.prepared_geom;
249  }
250  else
251  {
252  elog(ERROR, "AddPrepGeomHashEntry: This memory context is already in use! (%p)", (void *)pghe.context);
253  }
254 }
const GEOSPreparedGeometry * prepared_geom
const GEOSGeometry * geom
static HTAB * PrepGeomHash
Here is the caller graph for this function: