PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "miscadmin.h"
#include "storage/dsm.h"
#include "storage/ipc.h"
#include "storage/pg_shmem.h"
#include "utils/guc_hooks.h"
Go to the source code of this file.
Macros | |
#define | PROTECTIVE_REGION_SIZE (10 * WIN32_STACK_RLIMIT) |
Functions | |
static bool | EnableLockPagesPrivilege (int elevel) |
static void | pgwin32_SharedMemoryDelete (int status, Datum shmId) |
static char * | GetSharedMemName (void) |
bool | PGSharedMemoryIsInUse (unsigned long id1, unsigned long id2) |
PGShmemHeader * | PGSharedMemoryCreate (Size size, PGShmemHeader **shim) |
void | PGSharedMemoryReAttach (void) |
void | PGSharedMemoryNoReAttach (void) |
void | PGSharedMemoryDetach (void) |
int | pgwin32_ReserveSharedMemoryRegion (HANDLE hChild) |
void | GetHugePageSize (Size *hugepagesize, int *mmap_flags) |
bool | check_huge_page_size (int *newval, void **extra, GucSource source) |
Variables | |
void * | ShmemProtectiveRegion = NULL |
HANDLE | UsedShmemSegID = INVALID_HANDLE_VALUE |
void * | UsedShmemSegAddr = NULL |
static Size | UsedShmemSegSize = 0 |
#define PROTECTIVE_REGION_SIZE (10 * WIN32_STACK_RLIMIT) |
Definition at line 41 of file win32_shmem.c.
Definition at line 642 of file win32_shmem.c.
References GUC_check_errdetail, and newval.
|
static |
Definition at line 137 of file win32_shmem.c.
References _, ereport, errcode(), errdetail(), errhint(), and errmsg().
Referenced by PGSharedMemoryCreate().
void GetHugePageSize | ( | Size * | hugepagesize, |
int * | mmap_flags | ||
) |
Definition at line 630 of file win32_shmem.c.
|
static |
Definition at line 65 of file win32_shmem.c.
References bufsize, DataDir, elog, FATAL, and malloc.
Referenced by PGSharedMemoryCreate(), and PGSharedMemoryIsInUse().
PGShmemHeader* PGSharedMemoryCreate | ( | Size | size, |
PGShmemHeader ** | shim | ||
) |
Definition at line 207 of file win32_shmem.c.
References Assert, PGShmemHeader::creatorPID, DEBUG1, PGShmemHeader::dsm_control, elog, EnableLockPagesPrivilege(), ereport, errcode(), errdetail(), errhint(), errmsg(), errmsg_internal(), FATAL, free, PGShmemHeader::freeoffset, GetSharedMemName(), huge_pages, HUGE_PAGES_ON, HUGE_PAGES_TRY, i, LOG, PGShmemHeader::magic, MAXALIGN, on_shmem_exit(), PGC_INTERNAL, PGC_S_DYNAMIC_DEFAULT, PGShmemMagic, pgwin32_SharedMemoryDelete(), PointerGetDatum(), PROTECTIVE_REGION_SIZE, SetConfigOption(), ShmemProtectiveRegion, size, PGShmemHeader::totalsize, UsedShmemSegAddr, UsedShmemSegID, and UsedShmemSegSize.
void PGSharedMemoryDetach | ( | void | ) |
Definition at line 505 of file win32_shmem.c.
References elog, LOG, ShmemProtectiveRegion, UsedShmemSegAddr, and UsedShmemSegID.
Referenced by PGSharedMemoryNoReAttach(), and pgwin32_SharedMemoryDelete().
bool PGSharedMemoryIsInUse | ( | unsigned long | id1, |
unsigned long | id2 | ||
) |
void PGSharedMemoryNoReAttach | ( | void | ) |
Definition at line 472 of file win32_shmem.c.
References Assert, IsUnderPostmaster, PGSharedMemoryDetach(), ShmemProtectiveRegion, and UsedShmemSegAddr.
void PGSharedMemoryReAttach | ( | void | ) |
Definition at line 424 of file win32_shmem.c.
References Assert, PGShmemHeader::dsm_control, elog, FATAL, IsUnderPostmaster, PGShmemHeader::magic, PGShmemMagic, ShmemProtectiveRegion, UsedShmemSegAddr, and UsedShmemSegID.
int pgwin32_ReserveSharedMemoryRegion | ( | HANDLE | hChild | ) |
Definition at line 573 of file win32_shmem.c.
References Assert, elog, LOG, PROTECTIVE_REGION_SIZE, ShmemProtectiveRegion, UsedShmemSegAddr, and UsedShmemSegSize.
|
static |
Definition at line 549 of file win32_shmem.c.
References Assert, DatumGetPointer(), PGSharedMemoryDetach(), and UsedShmemSegID.
Referenced by PGSharedMemoryCreate().
void* ShmemProtectiveRegion = NULL |
Definition at line 42 of file win32_shmem.c.
Referenced by PGSharedMemoryCreate(), PGSharedMemoryDetach(), PGSharedMemoryNoReAttach(), PGSharedMemoryReAttach(), and pgwin32_ReserveSharedMemoryRegion().
void* UsedShmemSegAddr = NULL |
Definition at line 45 of file win32_shmem.c.
Referenced by PGSharedMemoryCreate(), PGSharedMemoryDetach(), PGSharedMemoryNoReAttach(), PGSharedMemoryReAttach(), and pgwin32_ReserveSharedMemoryRegion().
HANDLE UsedShmemSegID = INVALID_HANDLE_VALUE |
Definition at line 44 of file win32_shmem.c.
Referenced by PGSharedMemoryCreate(), PGSharedMemoryDetach(), PGSharedMemoryReAttach(), and pgwin32_SharedMemoryDelete().
|
static |
Definition at line 46 of file win32_shmem.c.
Referenced by PGSharedMemoryCreate(), and pgwin32_ReserveSharedMemoryRegion().