132 void (*init_callback) (
void *ptr),
bool *found)
142 (
errmsg(
"DSM segment name cannot be empty")));
146 (
errmsg(
"DSM segment name too long")));
150 (
errmsg(
"DSM segment size must be nonzero")));
171 (*init_callback) (ret);
176 (
errmsg(
"requested DSM segment size does not match size of "
177 "existing segment")));
188 elog(
ERROR,
"could not map dynamic shared memory segment");
#define Assert(condition)
dsa_area * dsa_attach(dsa_handle handle)
void dsa_pin_mapping(dsa_area *area)
dsa_handle dsa_get_handle(dsa_area *area)
void dsa_pin(dsa_area *area)
#define DSA_HANDLE_INVALID
#define dsa_create(tranch_id)
void dshash_strcpy(void *dest, const void *src, size_t size, void *arg)
void dshash_release_lock(dshash_table *hash_table, void *entry)
dshash_hash dshash_strhash(const void *v, size_t size, void *arg)
dshash_table_handle dshash_get_hash_table_handle(dshash_table *hash_table)
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)
dshash_table * dshash_attach(dsa_area *area, const dshash_parameters *params, dshash_table_handle handle, void *arg)
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_segment_address(dsm_segment *seg)
dsm_segment * dsm_attach(dsm_handle h)
dsm_segment * dsm_create(Size size, int flags)
void dsm_pin_mapping(dsm_segment *seg)
void dsm_pin_segment(dsm_segment *seg)
dsm_segment * dsm_find_mapping(dsm_handle handle)
void DSMRegistryShmemInit(void)
static void init_dsm_registry(void)
static DSMRegistryCtxStruct * DSMRegistryCtx
struct DSMRegistryEntry DSMRegistryEntry
static dshash_table * dsm_registry_table
void * GetNamedDSMSegment(const char *name, size_t size, void(*init_callback)(void *ptr), bool *found)
static dsa_area * dsm_registry_dsa
static const dshash_parameters dsh_params
struct DSMRegistryCtxStruct DSMRegistryCtxStruct
Size DSMRegistryShmemSize(void)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
void LWLockRelease(LWLock *lock)
@ LWTRANCHE_DSM_REGISTRY_DSA
@ LWTRANCHE_DSM_REGISTRY_HASH
MemoryContext TopMemoryContext
MemoryContextSwitchTo(old_ctx)
void * ShmemInitStruct(const char *name, Size size, bool *foundPtr)
static pg_noinline void Size size