110 LWTRANCHE_DSM_REGISTRY_HASH
187 void (*init_callback) (
void *ptr),
bool *found)
199 (
errmsg(
"DSM segment name cannot be empty")));
203 (
errmsg(
"DSM segment name too long")));
207 (
errmsg(
"DSM segment size must be nonzero")));
225 (
errmsg(
"requested DSM segment does not match type of existing entry")));
226 else if (
state->size != size)
228 (
errmsg(
"requested DSM segment size does not match size of existing segment")));
252 elog(
ERROR,
"could not map dynamic shared memory segment");
285 (
errmsg(
"DSA name cannot be empty")));
289 (
errmsg(
"DSA name too long")));
307 (
errmsg(
"requested DSA does not match type of existing entry")));
309 if (
state->tranche == -1)
331 (
errmsg(
"requested DSA already attached to current process")));
367 (
errmsg(
"DSHash name cannot be empty")));
371 (
errmsg(
"DSHash name too long")));
380 dsh_state = &entry->
dsh;
390 (
errmsg(
"requested DSHash does not match type of existing entry")));
424 (
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)
#define DSM_HANDLE_INVALID
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)