PostgreSQL Source Code
git master
|
#include "utils/hsearch.h"
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) |
Definition at line 502 of file shmem.c.
References ereport, errcode(), errmsg(), ERROR, s1, and s2.
Referenced by _bt_parallel_estimate_shared(), ApplyLauncherShmemSize(), AsyncShmemInit(), AsyncShmemSize(), AutoVacuumShmemSize(), BackendStatusShmemSize(), BackgroundWorkerShmemSize(), BTreeShmemSize(), BufferShmemSize(), CalculateShmemSize(), CheckpointerShmemSize(), CreateSharedProcArray(), estimate_variable_size(), EstimateClientConnectionInfoSpace(), EstimateComboCIDStateSpace(), EstimateGUCStateSpace(), EstimateLibraryStateSpace(), EstimateParamExecSpace(), EstimateParamListSpace(), EstimateSnapshotSpace(), EstimateTransactionStateSpace(), ExecAggEstimate(), ExecAppendEstimate(), ExecBitmapHeapEstimate(), ExecHashEstimate(), ExecIncrementalSortEstimate(), ExecMemoizeEstimate(), ExecSortEstimate(), expand_planner_arrays(), hash_estimate_size(), index_parallelscan_estimate(), index_parallelscan_initialize(), InitializeShmemGUCs(), LockShmemSize(), LWLockShmemSize(), MultiXactShmemSize(), PgArchShmemSize(), pgss_memsize(), PMSignalShmemSize(), PredicateLockShmemSize(), ProcArrayShmemSize(), ProcGlobalShmemSize(), ProcSignalShmemSize(), ReplicationOriginShmemSize(), ReplicationSlotsShmemSize(), RequestAddinShmemSpace(), SerializeTransactionState(), shm_toc_estimate(), SInvalShmemSize(), StatsShmemSize(), StrategyShmemSize(), table_parallelscan_estimate(), tuplesort_estimate_shared(), TwoPhaseShmemSize(), WaitEventExtensionShmemSize(), WalRcvShmemSize(), WalSndShmemSize(), and XLOGShmemSize().
void InitShmemAccess | ( | void * | seghdr | ) |
Definition at line 101 of file shmem.c.
References ShmemBase, ShmemEnd, ShmemSegHdr, and PGShmemHeader::totalsize.
Referenced by CreateSharedMemoryAndSemaphores().
void InitShmemAllocation | ( | void | ) |
Definition at line 116 of file shmem.c.
References Assert(), CACHELINEALIGN, PGShmemHeader::freeoffset, PGShmemHeader::index, ShmemAlloc(), ShmemAllocUnlocked(), ShmemIndex, ShmemLock, ShmemSegHdr, ShmemVariableCache, and SpinLockInit.
Referenced by CreateSharedMemoryAndSemaphores().
void InitShmemIndex | ( | void | ) |
Definition at line 292 of file shmem.c.
References HASHCTL::entrysize, HASH_ELEM, HASH_STRINGS, HASHCTL::keysize, SHMEM_INDEX_KEYSIZE, SHMEM_INDEX_SIZE, ShmemIndex, and ShmemInitHash().
Referenced by CreateSharedMemoryAndSemaphores().
Definition at line 519 of file shmem.c.
References ereport, errcode(), errmsg(), ERROR, s1, and s2.
Referenced by _bt_begin_parallel(), ApplyLauncherShmemSize(), AsyncShmemInit(), AsyncShmemSize(), AutoVacuumShmemSize(), BackendStatusShmemSize(), BackgroundWorkerShmemSize(), BTreeShmemSize(), BufferShmemSize(), CheckpointerShmemSize(), CreateSharedBackendStatus(), CreateSharedProcArray(), EstimateComboCIDStateSpace(), EstimatePendingSyncsSpace(), EstimateReindexStateSpace(), EstimateSnapshotSpace(), EstimateTransactionStateSpace(), ExecAggEstimate(), ExecHashEstimate(), ExecIncrementalSortEstimate(), ExecInitParallelPlan(), ExecMemoizeEstimate(), ExecParallelRetrieveInstrumentation(), ExecParallelRetrieveJitInstrumentation(), ExecParallelSetupTupleQueues(), ExecSortEstimate(), hash_estimate_size(), InitializeParallelDSM(), InitPredicateLocks(), LWLockShmemSize(), parallel_vacuum_init(), PGSemaphoreShmemSize(), PMSignalShmemSize(), PredicateLockShmemSize(), ProcArrayShmemSize(), ProcGlobalShmemSize(), ProcSignalShmemSize(), ReplicationOriginShmemSize(), ReplicationSlotsShmemSize(), shm_toc_estimate(), SInvalShmemSize(), tuplesort_estimate_shared(), TwoPhaseShmemSize(), WalSndShmemSize(), and XLOGShmemSize().
void RequestAddinShmemSpace | ( | Size | size | ) |
Definition at line 71 of file ipci.c.
References add_size(), elog(), FATAL, process_shmem_requests_in_progress, and total_addin_request.
Referenced by autoprewarm_shmem_request(), pgss_shmem_request(), and test_slru_shmem_request().
bool ShmemAddrIsValid | ( | const void * | addr | ) |
Definition at line 283 of file shmem.c.
References ShmemBase, and ShmemEnd.
Referenced by ReleasePredXact(), and ShmemInitStruct().
void* ShmemAlloc | ( | Size | size | ) |
Definition at line 161 of file shmem.c.
References ereport, errcode(), errmsg(), ERROR, and ShmemAllocRaw().
Referenced by CreateLWLocks(), InitPredicateLocks(), InitProcGlobal(), InitShmemAllocation(), and ShmemInitStruct().
void* ShmemAllocNoError | ( | Size | size | ) |
void* ShmemAllocUnlocked | ( | Size | size | ) |
Definition at line 247 of file shmem.c.
References Assert(), ereport, errcode(), errmsg(), ERROR, PGShmemHeader::freeoffset, MAXALIGN, ShmemBase, ShmemSegHdr, and PGShmemHeader::totalsize.
Referenced by InitShmemAllocation(), PGReserveSemaphores(), and SpinlockSemaInit().
HTAB* ShmemInitHash | ( | const char * | name, |
long | init_size, | ||
long | max_size, | ||
HASHCTL * | infoP, | ||
int | hash_flags | ||
) |
Definition at line 341 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(), InitLocks(), InitPredicateLocks(), InitShmemIndex(), pgss_shmem_startup(), and WaitEventExtensionShmemInit().
Definition at line 396 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, and ShmemIndexEnt::size.
Referenced by ApplyLauncherShmemInit(), apw_init_shmem(), AsyncShmemInit(), AutoVacuumShmemInit(), BackgroundWorkerShmemInit(), BTreeShmemInit(), CheckpointerShmemInit(), CommitTsShmemInit(), CreateSharedBackendStatus(), CreateSharedInvalidationState(), CreateSharedProcArray(), dsm_shmem_init(), InitBufferPool(), InitLocks(), InitPredicateLocks(), InitProcGlobal(), MultiXactShmemInit(), PgArchShmemInit(), pgss_shmem_startup(), PMSignalShmemInit(), ProcSignalShmemInit(), ReplicationOriginShmemInit(), ReplicationSlotsShmemInit(), SerialInit(), ShmemInitHash(), SimpleLruInit(), StatsShmemInit(), StrategyInitialize(), SyncScanShmemInit(), TwoPhaseShmemInit(), WaitEventExtensionShmemInit(), WalRcvShmemInit(), WalSndShmemInit(), XLogPrefetchShmemInit(), XLogRecoveryShmemInit(), and XLOGShmemInit().