PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ AddPrepGeomHashEntry()

static void AddPrepGeomHashEntry ( PrepGeomHashEntry  pghe)
static

Definition at line 230 of file lwgeom_geos_prepared.c.

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

Referenced by PrepGeomCacheBuilder().

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