PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | ShmemIndexEnt |
Macros | |
#define | SHMEM_INDEX_KEYSIZE (48) |
#define | SHMEM_INDEX_SIZE (64) |
Functions | |
void | InitShmemAccess (void *seghdr) |
void | InitShmemAllocation (void) |
void * | ShmemAlloc (Size size) |
void * | ShmemAllocNoError (Size size) |
void * | ShmemAllocUnlocked (Size size) |
bool | ShmemAddrIsValid (const void *addr) |
void | InitShmemIndex (void) |
HTAB * | ShmemInitHash (const char *name, long init_size, long max_size, HASHCTL *infoP, int hash_flags) |
void * | ShmemInitStruct (const char *name, Size size, bool *foundPtr) |
Size | add_size (Size s1, Size s2) |
Size | mul_size (Size s1, Size s2) |
void | RequestAddinShmemSpace (Size size) |
Variables | |
PGDLLIMPORT slock_t * | ShmemLock |
Definition at line 493 of file shmem.c.
References ereport, errcode(), errmsg(), ERROR, s1, and s2.
Referenced by _brin_parallel_estimate_shared(), _bt_parallel_estimate_shared(), ApplyLauncherShmemSize(), AsyncShmemInit(), AsyncShmemSize(), AutoVacuumShmemSize(), BackendStatusShmemSize(), BackgroundWorkerShmemSize(), BTreeShmemSize(), BufferManagerShmemSize(), CalculateShmemSize(), CheckpointerShmemSize(), estimate_variable_size(), EstimateClientConnectionInfoSpace(), EstimateComboCIDStateSpace(), EstimateGUCStateSpace(), EstimateLibraryStateSpace(), EstimateParamExecSpace(), EstimateParamListSpace(), EstimateSnapshotSpace(), EstimateTransactionStateSpace(), ExecAggEstimate(), ExecAppendEstimate(), ExecBitmapHeapEstimate(), ExecBitmapHeapInitializeDSM(), ExecHashEstimate(), ExecIncrementalSortEstimate(), ExecMemoizeEstimate(), ExecSortEstimate(), expand_planner_arrays(), hash_estimate_size(), index_parallelscan_estimate(), index_parallelscan_initialize(), InitializeShmemGUCs(), InjectionPointShmemSize(), LockManagerShmemSize(), LWLockShmemSize(), MultiXactShmemSize(), PgArchShmemSize(), pgss_memsize(), PMSignalShmemSize(), PredicateLockShmemSize(), ProcArrayShmemInit(), ProcArrayShmemSize(), ProcGlobalShmemSize(), ProcSignalShmemSize(), ReplicationOriginShmemSize(), ReplicationSlotsShmemSize(), RequestAddinShmemSpace(), SerializeTransactionState(), SharedInvalShmemSize(), shm_toc_estimate(), StatsShmemSize(), StrategyShmemSize(), table_parallelscan_estimate(), tuplesort_estimate_shared(), TwoPhaseShmemSize(), WaitEventCustomShmemSize(), WaitLSNShmemSize(), WalRcvShmemSize(), WalSndShmemSize(), and XLOGShmemSize().
void InitShmemAccess | ( | void * | seghdr | ) |
Definition at line 100 of file shmem.c.
References ShmemBase, ShmemEnd, ShmemSegHdr, and PGShmemHeader::totalsize.
Referenced by CreateSharedMemoryAndSemaphores().
void InitShmemAllocation | ( | void | ) |
Definition at line 115 of file shmem.c.
References Assert, CACHELINEALIGN, PGShmemHeader::freeoffset, PGShmemHeader::index, ShmemAllocUnlocked(), ShmemIndex, ShmemLock, ShmemSegHdr, and SpinLockInit.
Referenced by CreateSharedMemoryAndSemaphores().
void InitShmemIndex | ( | void | ) |
Definition at line 283 of file shmem.c.
References HASHCTL::entrysize, HASH_ELEM, HASH_STRINGS, HASHCTL::keysize, SHMEM_INDEX_KEYSIZE, SHMEM_INDEX_SIZE, ShmemIndex, and ShmemInitHash().
Referenced by CreateOrAttachShmemStructs().
Definition at line 510 of file shmem.c.
References ereport, errcode(), errmsg(), ERROR, s1, and s2.
Referenced by _brin_begin_parallel(), _bt_begin_parallel(), ApplyLauncherShmemSize(), AsyncShmemInit(), AsyncShmemSize(), AutoVacuumShmemSize(), BackendStatusShmemInit(), BackendStatusShmemSize(), BackgroundWorkerShmemSize(), BTreeShmemSize(), BufferManagerShmemSize(), CheckpointerShmemSize(), EstimateComboCIDStateSpace(), EstimatePendingSyncsSpace(), EstimateReindexStateSpace(), EstimateSnapshotSpace(), EstimateTransactionStateSpace(), ExecAggEstimate(), ExecBitmapHeapEstimate(), ExecBitmapHeapInitializeDSM(), ExecHashEstimate(), ExecIncrementalSortEstimate(), ExecInitParallelPlan(), ExecMemoizeEstimate(), ExecParallelRetrieveInstrumentation(), ExecParallelRetrieveJitInstrumentation(), ExecParallelSetupTupleQueues(), ExecSortEstimate(), hash_estimate_size(), InitializeParallelDSM(), LWLockShmemSize(), parallel_vacuum_init(), PGSemaphoreShmemSize(), PMSignalShmemSize(), PredicateLockShmemInit(), PredicateLockShmemSize(), ProcArrayShmemInit(), ProcArrayShmemSize(), ProcGlobalShmemSize(), ProcSignalShmemSize(), ReplicationOriginShmemSize(), ReplicationSlotsShmemSize(), SharedInvalShmemSize(), shm_toc_estimate(), tuplesort_estimate_shared(), TwoPhaseShmemSize(), WaitLSNShmemSize(), WalSndShmemSize(), and XLOGShmemSize().
void RequestAddinShmemSpace | ( | Size | size | ) |
Definition at line 76 of file ipci.c.
References add_size(), elog, FATAL, process_shmem_requests_in_progress, size, and total_addin_request.
Referenced by injection_shmem_request(), pgss_shmem_request(), and test_slru_shmem_request().
bool ShmemAddrIsValid | ( | const void * | addr | ) |
Definition at line 274 of file shmem.c.
References ShmemBase, and ShmemEnd.
Referenced by ReleasePredXact(), and ShmemInitStruct().
void* ShmemAlloc | ( | Size | size | ) |
Definition at line 152 of file shmem.c.
References ereport, errcode(), errmsg(), ERROR, ShmemAllocRaw(), and size.
Referenced by CreateLWLocks(), InitProcGlobal(), PredicateLockShmemInit(), ShmemInitStruct(), and StatsShmemInit().
void* ShmemAllocNoError | ( | Size | size | ) |
Definition at line 172 of file shmem.c.
References ShmemAllocRaw(), and size.
Referenced by ShmemInitHash().
void* ShmemAllocUnlocked | ( | Size | size | ) |
Definition at line 238 of file shmem.c.
References Assert, ereport, errcode(), errmsg(), ERROR, PGShmemHeader::freeoffset, MAXALIGN, ShmemBase, ShmemSegHdr, size, and PGShmemHeader::totalsize.
Referenced by InitShmemAllocation(), and PGReserveSemaphores().
HTAB* ShmemInitHash | ( | const char * | name, |
long | init_size, | ||
long | max_size, | ||
HASHCTL * | infoP, | ||
int | hash_flags | ||
) |
Definition at line 332 of file shmem.c.
References HASHCTL::alloc, HASHCTL::dsize, HASH_ALLOC, HASH_ATTACH, hash_create(), HASH_DIRSIZE, hash_get_shared_size(), hash_select_dirsize(), HASH_SHARED_MEM, HASHCTL::hctl, HASHCTL::max_dsize, name, ShmemAllocNoError(), and ShmemInitStruct().
Referenced by InitBufTable(), InitShmemIndex(), LockManagerShmemInit(), pgss_shmem_startup(), PredicateLockShmemInit(), and WaitEventCustomShmemInit().
Definition at line 387 of file shmem.c.
References ShmemIndexEnt::allocated_size, Assert, CACHELINEALIGN, ereport, errcode(), errmsg(), ERROR, HASH_ENTER_NULL, HASH_REMOVE, hash_search(), PGShmemHeader::index, IsUnderPostmaster, ShmemIndexEnt::location, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), name, ShmemAddrIsValid(), ShmemAlloc(), ShmemAllocRaw(), ShmemIndex, ShmemSegHdr, size, and ShmemIndexEnt::size.
Referenced by ApplyLauncherShmemInit(), AsyncShmemInit(), AutoVacuumShmemInit(), BackendStatusShmemInit(), BackgroundWorkerShmemInit(), BTreeShmemInit(), BufferManagerShmemInit(), CheckpointerShmemInit(), CommitTsShmemInit(), dsm_shmem_init(), DSMRegistryShmemInit(), InitProcGlobal(), injection_shmem_startup(), InjectionPointShmemInit(), LockManagerShmemInit(), MultiXactShmemInit(), PgArchShmemInit(), pgss_shmem_startup(), PMSignalShmemInit(), PredicateLockShmemInit(), ProcArrayShmemInit(), ProcSignalShmemInit(), ReplicationOriginShmemInit(), ReplicationSlotsShmemInit(), SerialInit(), SharedInvalShmemInit(), ShmemInitHash(), SimpleLruInit(), SlotSyncShmemInit(), StatsShmemInit(), StrategyInitialize(), SyncScanShmemInit(), TwoPhaseShmemInit(), VarsupShmemInit(), WaitEventCustomShmemInit(), WaitLSNShmemInit(), WalRcvShmemInit(), WalSndShmemInit(), WalSummarizerShmemInit(), XLogPrefetchShmemInit(), XLogRecoveryShmemInit(), and XLOGShmemInit().
|
extern |
Definition at line 87 of file shmem.c.
Referenced by InitShmemAllocation(), LWLockNewTrancheId(), and ShmemAllocRaw().