111 LWTRANCHE_DSM_REGISTRY_HASH
187 void (*init_callback) (
void *ptr),
bool *found)
197 (
errmsg(
"DSM segment name cannot be empty")));
201 (
errmsg(
"DSM segment name too long")));
205 (
errmsg(
"DSM segment size must be nonzero")));
232 (*init_callback) (ret);
238 (
errmsg(
"requested DSM segment \"%s\" does not match type of existing entry",
242 (
errmsg(
"requested DSM segment \"%s\" failed initialization",
244 else if (entry->
dsm.
size != size)
246 (
errmsg(
"requested DSM segment \"%s\" does not match size of existing entry",
259 elog(
ERROR,
"could not map dynamic shared memory segment");
292 (
errmsg(
"DSA name cannot be empty")));
296 (
errmsg(
"DSA name too long")));
327 (
errmsg(
"requested DSA \"%s\" does not match type of existing entry",
331 (
errmsg(
"requested DSA \"%s\" failed initialization",
339 (
errmsg(
"requested DSA already attached to current process")));
373 (
errmsg(
"DSHash name cannot be empty")));
377 (
errmsg(
"DSHash name too long")));
416 (
errmsg(
"requested DSHash \"%s\" does not match type of existing entry",
420 (
errmsg(
"requested DSHash \"%s\" failed initialization",
431 (
errmsg(
"requested DSHash already attached to current process")));
#define CStringGetTextDatum(s)
dsa_area * dsa_attach(dsa_handle handle)
void dsa_pin_mapping(dsa_area *area)
dsa_handle dsa_get_handle(dsa_area *area)
bool dsa_is_attached(dsa_handle handle)
void dsa_pin(dsa_area *area)
#define dsa_create(tranche_id)
#define DSA_HANDLE_INVALID
void dshash_strcpy(void *dest, const void *src, size_t size, void *arg)
void dshash_release_lock(dshash_table *hash_table, void *entry)
void dshash_seq_init(dshash_seq_status *status, dshash_table *hash_table, bool exclusive)
dshash_hash dshash_strhash(const void *v, size_t size, void *arg)
dshash_table_handle dshash_get_hash_table_handle(dshash_table *hash_table)
dshash_table * dshash_attach(dsa_area *area, const dshash_parameters *params, dshash_table_handle handle, void *arg)
void dshash_seq_term(dshash_seq_status *status)
int dshash_strcmp(const void *a, const void *b, size_t size, void *arg)
void * dshash_find_or_insert(dshash_table *hash_table, const void *key, bool *found)
void * dshash_seq_next(dshash_seq_status *status)
dshash_table * dshash_create(dsa_area *area, const dshash_parameters *params, void *arg)
#define DSHASH_HANDLE_INVALID
dsa_pointer dshash_table_handle
dsm_handle dsm_segment_handle(dsm_segment *seg)
void dsm_pin_mapping(dsm_segment *seg)
void dsm_pin_segment(dsm_segment *seg)
void * dsm_segment_address(dsm_segment *seg)
dsm_segment * dsm_create(Size size, int flags)
dsm_segment * dsm_attach(dsm_handle h)
dsm_segment * dsm_find_mapping(dsm_handle handle)
dsa_area * GetNamedDSA(const char *name, bool *found)
Datum pg_get_dsm_registry_allocations(PG_FUNCTION_ARGS)
struct NamedDSMState NamedDSMState
void DSMRegistryShmemInit(void)
static void init_dsm_registry(void)
static const char *const DSMREntryTypeNames[]
struct NamedDSAState NamedDSAState
static DSMRegistryCtxStruct * DSMRegistryCtx
struct DSMRegistryEntry DSMRegistryEntry
static dshash_table * dsm_registry_table
dshash_table * GetNamedDSHash(const char *name, const dshash_parameters *params, bool *found)
static dsa_area * dsm_registry_dsa
static const dshash_parameters dsh_params
struct DSMRegistryCtxStruct DSMRegistryCtxStruct
struct NamedDSHState NamedDSHState
Size DSMRegistryShmemSize(void)
void * GetNamedDSMSegment(const char *name, size_t size, void(*init_callback)(void *ptr), bool *found)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
void InitMaterializedSRF(FunctionCallInfo fcinfo, bits32 flags)
#define MAT_SRF_USE_EXPECTED_DESC
Assert(PointerIsAligned(start, uint64))
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
int LWLockNewTrancheId(const char *name)
void LWLockRelease(LWLock *lock)
MemoryContext TopMemoryContext
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
static Datum Int64GetDatum(int64 X)
void * ShmemInitStruct(const char *name, Size size, bool *foundPtr)
dshash_table_handle dsh_handle
Tuplestorestate * setResult
void tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc, const Datum *values, const bool *isnull)