190 bool *found,
void *
arg)
202 (
errmsg(
"DSM segment name cannot be empty")));
206 (
errmsg(
"DSM segment name too long")));
210 (
errmsg(
"DSM segment size must be nonzero")));
228 (
errmsg(
"requested DSM segment does not match type of existing entry")));
229 else if (
state->size != size)
231 (
errmsg(
"requested DSM segment size does not match size of existing segment")));
255 elog(
ERROR,
"could not map dynamic shared memory segment");
288 (
errmsg(
"DSA name cannot be empty")));
292 (
errmsg(
"DSA name too long")));
310 (
errmsg(
"requested DSA does not match type of existing entry")));
312 if (
state->tranche == -1)
334 (
errmsg(
"requested DSA already attached to current process")));
370 (
errmsg(
"DSHash name cannot be empty")));
374 (
errmsg(
"DSHash name too long")));
393 (
errmsg(
"requested DSHash does not match type of existing entry")));
427 (
errmsg(
"requested DSHash already attached to current process")));
#define CStringGetTextDatum(s)
#define Assert(condition)
dsa_area * dsa_attach(dsa_handle handle)
size_t dsa_get_total_size_from_handle(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_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
#define dshash_find_or_insert(hash_table, key, found)
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)
void * GetNamedDSMSegment(const char *name, size_t size, void(*init_callback)(void *ptr, void *arg), bool *found, void *arg)
Datum pg_get_dsm_registry_allocations(PG_FUNCTION_ARGS)
void DSMRegistryShmemInit(void)
static void init_dsm_registry(void)
static const char *const DSMREntryTypeNames[]
static DSMRegistryCtxStruct * DSMRegistryCtx
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
Size DSMRegistryShmemSize(void)
#define ereport(elevel,...)
void InitMaterializedSRF(FunctionCallInfo fcinfo, bits32 flags)
#define MAT_SRF_USE_EXPECTED_DESC
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
void tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc, const Datum *values, const bool *isnull)