PostgreSQL Source Code
git master
|
#include "storage/dsm_impl.h"
Go to the source code of this file.
Data Structures | |
struct | PGShmemHeader |
Macros | |
#define | PGShmemMagic 679834894 |
#define | DEFAULT_SHARED_MEMORY_TYPE SHMEM_TYPE_MMAP |
Typedefs | |
typedef struct PGShmemHeader | PGShmemHeader |
Enumerations | |
enum | HugePagesType { HUGE_PAGES_OFF , HUGE_PAGES_ON , HUGE_PAGES_TRY , HUGE_PAGES_UNKNOWN } |
enum | PGShmemType { SHMEM_TYPE_WINDOWS , SHMEM_TYPE_SYSV , SHMEM_TYPE_MMAP } |
Functions | |
PGShmemHeader * | PGSharedMemoryCreate (Size size, PGShmemHeader **shim) |
bool | PGSharedMemoryIsInUse (unsigned long id1, unsigned long id2) |
void | PGSharedMemoryDetach (void) |
void | GetHugePageSize (Size *hugepagesize, int *mmap_flags) |
Variables | |
PGDLLIMPORT int | shared_memory_type |
PGDLLIMPORT int | huge_pages |
PGDLLIMPORT int | huge_page_size |
PGDLLIMPORT unsigned long | UsedShmemSegID |
PGDLLIMPORT void * | UsedShmemSegAddr |
#define DEFAULT_SHARED_MEMORY_TYPE SHMEM_TYPE_MMAP |
Definition at line 75 of file pg_shmem.h.
#define PGShmemMagic 679834894 |
Definition at line 32 of file pg_shmem.h.
typedef struct PGShmemHeader PGShmemHeader |
enum HugePagesType |
Enumerator | |
---|---|
HUGE_PAGES_OFF | |
HUGE_PAGES_ON | |
HUGE_PAGES_TRY | |
HUGE_PAGES_UNKNOWN |
Definition at line 50 of file pg_shmem.h.
enum PGShmemType |
Enumerator | |
---|---|
SHMEM_TYPE_WINDOWS | |
SHMEM_TYPE_SYSV | |
SHMEM_TYPE_MMAP |
Definition at line 59 of file pg_shmem.h.
void GetHugePageSize | ( | Size * | hugepagesize, |
int * | mmap_flags | ||
) |
Definition at line 479 of file sysv_shmem.c.
References AllocateFile(), buf, FreeFile(), huge_page_size, and pg_ceil_log2_64().
Referenced by CreateAnonymousSegment(), and InitializeShmemGUCs().
PGShmemHeader* PGSharedMemoryCreate | ( | Size | size, |
PGShmemHeader ** | shim | ||
) |
Definition at line 700 of file sysv_shmem.c.
References AnonymousShmem, AnonymousShmemDetach(), AnonymousShmemSize, Assert, CreateAnonymousSegment(), PGShmemHeader::creatorPID, DataDir, DEBUG1, PGShmemHeader::device, dsm_cleanup_using_control_segment(), PGShmemHeader::dsm_control, elog, EnableLockPagesPrivilege(), ereport, errcode(), errcode_for_file_access(), errdetail(), errhint(), errmsg(), errmsg_internal(), ERROR, FATAL, free, PGShmemHeader::freeoffset, GetSharedMemName(), huge_pages, HUGE_PAGES_ON, HUGE_PAGES_TRY, i, PGShmemHeader::inode, InternalIpcMemoryCreate(), IPC_RMID, LOG, PGShmemHeader::magic, MAXALIGN, on_shmem_exit(), PGC_INTERNAL, PGC_S_DYNAMIC_DEFAULT, PGSharedMemoryAttach(), PGShmemMagic, pgwin32_SharedMemoryDelete(), PointerGetDatum(), PROTECTIVE_REGION_SIZE, SetConfigOption(), shared_memory_type, SHMEM_TYPE_MMAP, ShmemProtectiveRegion, SHMSTATE_ANALYSIS_FAILURE, SHMSTATE_ATTACHED, SHMSTATE_ENOENT, SHMSTATE_FOREIGN, SHMSTATE_UNATTACHED, size, stat::st_dev, stat::st_ino, stat, PGShmemHeader::totalsize, UsedShmemSegAddr, UsedShmemSegID, and UsedShmemSegSize.
Referenced by CreateSharedMemoryAndSemaphores().
void PGSharedMemoryDetach | ( | void | ) |
Definition at line 970 of file sysv_shmem.c.
References AnonymousShmem, AnonymousShmemSize, elog, LOG, ShmemProtectiveRegion, UsedShmemSegAddr, and UsedShmemSegID.
Referenced by PGSharedMemoryNoReAttach(), pgwin32_SharedMemoryDelete(), and postmaster_child_launch().
bool PGSharedMemoryIsInUse | ( | unsigned long | id1, |
unsigned long | id2 | ||
) |
Definition at line 317 of file sysv_shmem.c.
References elog, free, GetSharedMemName(), LOG, PGSharedMemoryAttach(), SHMSTATE_ANALYSIS_FAILURE, SHMSTATE_ATTACHED, SHMSTATE_ENOENT, SHMSTATE_FOREIGN, and SHMSTATE_UNATTACHED.
Referenced by CreateLockFile().
|
extern |
Definition at line 563 of file guc_tables.c.
Referenced by GetHugePageSize().
|
extern |
Definition at line 562 of file guc_tables.c.
Referenced by CreateAnonymousSegment(), and PGSharedMemoryCreate().
|
extern |
Definition at line 55 of file ipci.c.
Referenced by PGSharedMemoryCreate().
|
extern |
Definition at line 95 of file sysv_shmem.c.
Referenced by PGSharedMemoryCreate(), PGSharedMemoryDetach(), PGSharedMemoryNoReAttach(), PGSharedMemoryReAttach(), and pgwin32_ReserveSharedMemoryRegion().
|
extern |
Definition at line 94 of file sysv_shmem.c.
Referenced by PGSharedMemoryCreate(), PGSharedMemoryDetach(), PGSharedMemoryReAttach(), and pgwin32_SharedMemoryDelete().