git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b5ed219)
Fix Windows build.
Mon, 8 Jul 2013 14:28:48 +0000 (17:28 +0300)
Mon, 8 Jul 2013 14:28:48 +0000 (17:28 +0300)
Was broken by my xloginsert scaling patch. XLogCtl global variable needs
to be initialized in each process, as it's not inherited by fork() on
Windows.


diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index acf0dd187619b03a2fc08387fd61301b05d6dd3c..c9e3a7af7b3b35b95d017f06e749739c715a8524 100644 (file)
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -5074,7 +5074,8 @@ XLOGShmemInit(void)
ControlFile = (ControlFileData *)
ShmemInitStruct("Control File", sizeof(ControlFileData), &foundCFile);
- allocptr = ShmemInitStruct("XLOG Ctl", XLOGShmemSize(), &foundXLog);
+ XLogCtl = (XLogCtlData *)
+ ShmemInitStruct("XLOG Ctl", XLOGShmemSize(), &foundXLog);
if (foundCFile || foundXLog)
{
@@ -5082,7 +5083,6 @@ XLOGShmemInit(void)
Assert(foundCFile && foundXLog);
return;
}
- XLogCtl = (XLogCtlData *) allocptr;
memset(XLogCtl, 0, sizeof(XLogCtlData));
/*
@@ -5090,7 +5090,7 @@ XLOGShmemInit(void)
* multiple of the alignment for same, so no extra alignment padding is
* needed here.
*/
- allocptr += sizeof(XLogCtlData);
+ allocptr = ((char *) XLogCtl) + sizeof(XLogCtlData);
XLogCtl->xlblocks = (XLogRecPtr *) allocptr;
memset(XLogCtl->xlblocks, 0, sizeof(XLogRecPtr) * XLOGbuffers);
allocptr += sizeof(XLogRecPtr) * XLOGbuffers;
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /