summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane2006-10-15 22:04:08 +0000
committerTom Lane2006-10-15 22:04:08 +0000
commite0dece127db86f40cdcf1fa63441eac93a1ba5ff (patch)
tree1713a636909c4a8cd14a7b84daef54955cf05e85 /src/include
parenta3dff39c53bddf633bc0ba2ab3dc8681be50d6bf (diff)
Redesign the patch for allocation of shmem space and LWLocks for add-on
modules; the first try was not usable in EXEC_BACKEND builds (e.g., Windows). Instead, just provide some entry points to increase the allocation requests during postmaster start, and provide a dedicated LWLock that can be used to synchronize allocation operations performed by backends. Per discussion with Marc Munro.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/storage/lwlock.h5
-rw-r--r--src/include/storage/pg_shmem.h9
-rw-r--r--src/include/storage/shmem.h10
3 files changed, 8 insertions, 16 deletions
diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h
index 5c4db528920..47025fd2d67 100644
--- a/src/include/storage/lwlock.h
+++ b/src/include/storage/lwlock.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/storage/lwlock.h,v 1.31 2006/08/01 19:03:11 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/storage/lwlock.h,v 1.32 2006/10/15 22:04:07 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -60,6 +60,7 @@ typedef enum LWLockId
TwoPhaseStateLock,
TablespaceCreateLock,
BtreeVacuumLock,
+ AddinShmemInitLock,
FirstBufMappingLock,
FirstLockMgrLock = FirstBufMappingLock + NUM_BUFFER_PARTITIONS,
@@ -92,6 +93,6 @@ extern int NumLWLocks(void);
extern Size LWLockShmemSize(void);
extern void CreateLWLocks(void);
-extern void RegisterAddinLWLock(LWLockId *lock);
+extern void RequestAddinLWLocks(int n);
#endif /* LWLOCK_H */
diff --git a/src/include/storage/pg_shmem.h b/src/include/storage/pg_shmem.h
index 52de6a94048..c4e01090ad9 100644
--- a/src/include/storage/pg_shmem.h
+++ b/src/include/storage/pg_shmem.h
@@ -17,7 +17,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/storage/pg_shmem.h,v 1.20 2006/10/04 00:30:10 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/storage/pg_shmem.h,v 1.21 2006/10/15 22:04:07 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -51,11 +51,4 @@ extern PGShmemHeader *PGSharedMemoryCreate(Size size, bool makePrivate,
extern bool PGSharedMemoryIsInUse(unsigned long id1, unsigned long id2);
extern void PGSharedMemoryDetach(void);
-
-extern void RegisterAddinContext(const char *name, Size size);
-extern Size AddinShmemSize(void);
-extern void InitAddinContexts(void *start);
-extern void *ShmemAllocFromContext(Size size, const char *name);
-extern void ShmemResetContext(const char *name);
-
#endif /* PG_SHMEM_H */
diff --git a/src/include/storage/shmem.h b/src/include/storage/shmem.h
index bd55fbdb5c8..ff6b0b7c21b 100644
--- a/src/include/storage/shmem.h
+++ b/src/include/storage/shmem.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/storage/shmem.h,v 1.48 2006/08/01 19:03:11 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/storage/shmem.h,v 1.49 2006/10/15 22:04:08 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -38,11 +38,6 @@ typedef unsigned long SHMEM_OFFSET;
extern DLLIMPORT SHMEM_OFFSET ShmemBase;
-/* coerce an offset into a pointer in a specified address space. This
- * macro (only) is not confined to the primary shared memory region */
-#define MAKE_PTRFROM(base,xx_offs)\
- (base+((unsigned long)(xx_offs)))
-
/* coerce an offset into a pointer in this process's address space */
#define MAKE_PTR(xx_offs)\
(ShmemBase+((unsigned long)(xx_offs)))
@@ -77,6 +72,9 @@ extern void *ShmemInitStruct(const char *name, Size size, bool *foundPtr);
extern Size add_size(Size s1, Size s2);
extern Size mul_size(Size s1, Size s2);
+/* ipci.c */
+extern void RequestAddinShmemSpace(Size size);
+
/* size constants for the shmem index table */
/* max size of data structure string name */
#define SHMEM_INDEX_KEYSIZE (48)