30 #define SESSION_MAGIC 0xabb0fbc9 39 #define SESSION_DSA_SIZE 0x30000 44 #define SESSION_KEY_DSA UINT64CONST(0xFFFFFFFFFFFF0001) 45 #define SESSION_KEY_RECORD_TYPMOD_REGISTRY UINT64CONST(0xFFFFFFFFFFFF0002) 75 size_t typmod_registry_size;
78 void *typmod_registry_space;
87 if (CurrentSession->
segment != NULL)
128 typmod_registry_space, seg, dsa);
130 typmod_registry_space);
144 CurrentSession->
area = dsa;
160 void *typmod_registry_space;
169 elog(
ERROR,
"could not attach to per-session DSM segment");
178 CurrentSession->
area = dsa;
181 typmod_registry_space =
184 typmod_registry_space);
205 CurrentSession->
segment = NULL;
207 CurrentSession->
area = NULL;
#define SESSION_KEY_RECORD_TYPMOD_REGISTRY
shm_toc * shm_toc_create(uint64 magic, void *address, Size nbytes)
void InitializeSession(void)
dsm_segment * dsm_attach(dsm_handle h)
dsa_area * dsa_attach_in_place(void *place, dsm_segment *segment)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
dsm_handle dsm_segment_handle(dsm_segment *seg)
Size shm_toc_estimate(shm_toc_estimator *e)
#define shm_toc_estimate_chunk(e, sz)
void SharedRecordTypmodRegistryAttach(SharedRecordTypmodRegistry *registry)
void SharedRecordTypmodRegistryInit(SharedRecordTypmodRegistry *registry, dsm_segment *segment, dsa_area *area)
#define DSM_HANDLE_INVALID
void dsm_pin_mapping(dsm_segment *seg)
#define DSM_CREATE_NULL_IF_MAXSEGMENTS
void dsa_detach(dsa_area *area)
void AttachSession(dsm_handle handle)
#define shm_toc_initialize_estimator(e)
void dsa_pin_mapping(dsa_area *area)
dsa_area * dsa_create_in_place(void *place, size_t size, int tranche_id, dsm_segment *segment)
MemoryContext TopMemoryContext
dsm_segment * dsm_create(Size size, int flags)
shm_toc * shm_toc_attach(uint64 magic, void *address)
void * MemoryContextAllocZero(MemoryContext context, Size size)
size_t SharedRecordTypmodRegistryEstimate(void)
void * dsm_segment_address(dsm_segment *seg)
#define shm_toc_estimate_keys(e, cnt)
void * shm_toc_allocate(shm_toc *toc, Size nbytes)
void dsm_detach(dsm_segment *seg)
void shm_toc_insert(shm_toc *toc, uint64 key, void *address)
dsm_handle GetSessionDsmHandle(void)
void * shm_toc_lookup(shm_toc *toc, uint64 key, bool noError)