PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/session.h"
#include "storage/lwlock.h"
#include "storage/shm_toc.h"
#include "utils/memutils.h"
#include "utils/typcache.h"
Go to the source code of this file.
Macros | |
#define | SESSION_MAGIC 0xabb0fbc9 |
#define | SESSION_DSA_SIZE 0x30000 |
#define | SESSION_KEY_DSA UINT64CONST(0xFFFFFFFFFFFF0001) |
#define | SESSION_KEY_RECORD_TYPMOD_REGISTRY UINT64CONST(0xFFFFFFFFFFFF0002) |
Functions | |
void | InitializeSession (void) |
dsm_handle | GetSessionDsmHandle (void) |
void | AttachSession (dsm_handle handle) |
void | DetachSession (void) |
Variables | |
Session * | CurrentSession = NULL |
#define SESSION_KEY_DSA UINT64CONST(0xFFFFFFFFFFFF0001) |
#define SESSION_KEY_RECORD_TYPMOD_REGISTRY UINT64CONST(0xFFFFFFFFFFFF0002) |
void AttachSession | ( | dsm_handle | handle | ) |
Definition at line 155 of file session.c.
References Session::area, CurrentSession, dsa_attach_in_place(), dsa_pin_mapping(), dsm_attach(), dsm_pin_mapping(), dsm_segment_address(), elog, ERROR, MemoryContextSwitchTo(), Session::segment, SESSION_KEY_DSA, SESSION_KEY_RECORD_TYPMOD_REGISTRY, SESSION_MAGIC, SharedRecordTypmodRegistryAttach(), shm_toc_attach(), shm_toc_lookup(), and TopMemoryContext.
Referenced by ParallelWorkerMain().
void DetachSession | ( | void | ) |
Definition at line 201 of file session.c.
References Session::area, CurrentSession, dsa_detach(), dsm_detach(), and Session::segment.
Referenced by ParallelWorkerMain().
dsm_handle GetSessionDsmHandle | ( | void | ) |
Definition at line 70 of file session.c.
References Session::area, CurrentSession, dsa_create_in_place, dsa_pin_mapping(), dsm_create(), DSM_CREATE_NULL_IF_MAXSEGMENTS, DSM_HANDLE_INVALID, dsm_pin_mapping(), dsm_segment_address(), dsm_segment_handle(), LWTRANCHE_PER_SESSION_DSA, MemoryContextSwitchTo(), Session::segment, SESSION_DSA_SIZE, SESSION_KEY_DSA, SESSION_KEY_RECORD_TYPMOD_REGISTRY, SESSION_MAGIC, SharedRecordTypmodRegistryEstimate(), SharedRecordTypmodRegistryInit(), shm_toc_allocate(), shm_toc_create(), shm_toc_estimate(), shm_toc_estimate_chunk, shm_toc_estimate_keys, shm_toc_initialize_estimator, shm_toc_insert(), size, and TopMemoryContext.
Referenced by InitializeParallelDSM().
void InitializeSession | ( | void | ) |
Definition at line 54 of file session.c.
References CurrentSession, MemoryContextAllocZero(), and TopMemoryContext.
Referenced by InitPostgres().
Session* CurrentSession = NULL |
Definition at line 48 of file session.c.
Referenced by AttachSession(), DetachSession(), find_or_make_matching_shared_tupledesc(), GetSessionDsmHandle(), InitializeSession(), lookup_rowtype_tupdesc_internal(), shared_record_typmod_registry_detach(), SharedRecordTypmodRegistryAttach(), and SharedRecordTypmodRegistryInit().