unsigned long UsedShmemSegID = 0;
void *UsedShmemSegAddr = NULL;
static Size AnonymousShmemSize;
-static PGShmemHeader *AnonymousShmem;
+static void *AnonymousShmem;
static void *InternalIpcMemoryCreate(IpcMemoryKey memKey, Size size);
static void IpcMemoryDetach(int status, Datum shmaddr);
PGShmemHeader *hdr;
IpcMemoryId shmid;
struct stat statbuf;
- Size allocsize = size;
+ Size sysvsize = size;
/* Room for a header? */
Assert(size > MAXALIGN(sizeof(PGShmemHeader)));
AnonymousShmemSize = size;
/* Now we need only allocate a minimal-sized SysV shmem block. */
- allocsize = sizeof(PGShmemHeader);
+ sysvsize = sizeof(PGShmemHeader);
}
#endif
for (NextShmemSegID++;; NextShmemSegID++)
{
/* Try to create new segment */
- memAddress = InternalIpcMemoryCreate(NextShmemSegID, allocsize);
+ memAddress = InternalIpcMemoryCreate(NextShmemSegID, sysvsize);
if (memAddress)
break; /* successful create and attach */
/*
* Now try again to create the segment.
*/
- memAddress = InternalIpcMemoryCreate(NextShmemSegID, allocsize);
+ memAddress = InternalIpcMemoryCreate(NextShmemSegID, sysvsize);
if (memAddress)
break; /* successful create and attach */
if (AnonymousShmem == NULL)
return hdr;
memcpy(AnonymousShmem, hdr, sizeof(PGShmemHeader));
- return AnonymousShmem;
-
+ return (PGShmemHeader *) AnonymousShmem;
}
#ifdef EXEC_BACKEND