Skip to content

Commit f489470

Browse files
committed
Fix Windows build.
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.
1 parent b5ed219 commit f489470

File tree

1 file changed

+3
-3
lines changed
  • src/backend/access/transam

1 file changed

+3
-3
lines changed

src/backend/access/transam/xlog.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5074,23 +5074,23 @@ XLOGShmemInit(void)
50745074

50755075
ControlFile = (ControlFileData *)
50765076
ShmemInitStruct("Control File", sizeof(ControlFileData), &foundCFile);
5077-
allocptr = ShmemInitStruct("XLOG Ctl", XLOGShmemSize(), &foundXLog);
5077+
XLogCtl = (XLogCtlData *)
5078+
ShmemInitStruct("XLOG Ctl", XLOGShmemSize(), &foundXLog);
50785079

50795080
if (foundCFile || foundXLog)
50805081
{
50815082
/* both should be present or neither */
50825083
Assert(foundCFile && foundXLog);
50835084
return;
50845085
}
5085-
XLogCtl = (XLogCtlData *) allocptr;
50865086
memset(XLogCtl, 0, sizeof(XLogCtlData));
50875087

50885088
/*
50895089
* Since XLogCtlData contains XLogRecPtr fields, its sizeof should be a
50905090
* multiple of the alignment for same, so no extra alignment padding is
50915091
* needed here.
50925092
*/
5093-
allocptr += sizeof(XLogCtlData);
5093+
allocptr = ((char *) XLogCtl) + sizeof(XLogCtlData);
50945094
XLogCtl->xlblocks = (XLogRecPtr *) allocptr;
50955095
memset(XLogCtl->xlblocks, 0, sizeof(XLogRecPtr) * XLOGbuffers);
50965096
allocptr += sizeof(XLogRecPtr) * XLOGbuffers;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy