@@ -5074,23 +5074,23 @@ XLOGShmemInit(void)
5074
5074
5075
5075
ControlFile = (ControlFileData * )
5076
5076
ShmemInitStruct ("Control File" ,sizeof (ControlFileData ),& foundCFile );
5077
- allocptr = ShmemInitStruct ("XLOG Ctl" ,XLOGShmemSize (),& foundXLog );
5077
+ XLogCtl = (XLogCtlData * )
5078
+ ShmemInitStruct ("XLOG Ctl" ,XLOGShmemSize (),& foundXLog );
5078
5079
5079
5080
if (foundCFile || foundXLog )
5080
5081
{
5081
5082
/* both should be present or neither */
5082
5083
Assert (foundCFile && foundXLog );
5083
5084
return ;
5084
5085
}
5085
- XLogCtl = (XLogCtlData * )allocptr ;
5086
5086
memset (XLogCtl ,0 ,sizeof (XLogCtlData ));
5087
5087
5088
5088
/*
5089
5089
* Since XLogCtlData contains XLogRecPtr fields, its sizeof should be a
5090
5090
* multiple of the alignment for same, so no extra alignment padding is
5091
5091
* needed here.
5092
5092
*/
5093
- allocptr += sizeof (XLogCtlData );
5093
+ allocptr = (( char * ) XLogCtl ) + sizeof (XLogCtlData );
5094
5094
XLogCtl -> xlblocks = (XLogRecPtr * )allocptr ;
5095
5095
memset (XLogCtl -> xlblocks ,0 ,sizeof (XLogRecPtr )* XLOGbuffers );
5096
5096
allocptr += sizeof (XLogRecPtr )* XLOGbuffers ;