1/*-------------------------------------------------------------------------
4 * shared memory management structures
7 * A long time ago, Postgres' shared memory region was allowed to be mapped
8 * at a different address in each process, and shared memory "pointers" were
9 * passed around as offsets relative to the start of the shared memory region.
10 * That is no longer the case: each process must map the shared memory region
11 * at the same address. This means shared memory pointers can be passed
12 * around directly between different processes.
14 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
15 * Portions Copyright (c) 1994, Regents of the University of California
17 * src/include/storage/shmem.h
19 *-------------------------------------------------------------------------
31 * storage/pg_shmem.h here */
40 HASHCTL *infoP,
int hash_flags);
50/* size constants for the shmem index table */
51 /* max size of data structure string name */
52 #define SHMEM_INDEX_KEYSIZE (48)
53 /* estimated size of the shmem index table (not a hard limit) */
54 #define SHMEM_INDEX_SIZE (64)
56/* this is a hash bucket in the shmem index table */
61 Size size;
/* # bytes requested for the structure */
bool ShmemAddrIsValid(const void *addr)
void InitShmemIndex(void)
void InitShmemAccess(PGShmemHeader *seghdr)
Size add_size(Size s1, Size s2)
void * ShmemAllocUnlocked(Size size)
PGDLLIMPORT Size pg_get_shmem_pagesize(void)
PGDLLIMPORT slock_t * ShmemLock
void * ShmemAllocNoError(Size size)
Size mul_size(Size s1, Size s2)
void * ShmemAlloc(Size size)
HTAB * ShmemInitHash(const char *name, int64 init_size, int64 max_size, HASHCTL *infoP, int hash_flags)
void InitShmemAllocation(void)
void RequestAddinShmemSpace(Size size)
void * ShmemInitStruct(const char *name, Size size, bool *foundPtr)
#define SHMEM_INDEX_KEYSIZE