This makes them visible in pg_shmem_allocations
Reviewed-by: Tomas Vondra <tomas@vondra.me>
Discussion: https://www.postgresql.org/message-id/
01ab1d41-3eda-4705-8bbd-
af898f5007f1@iki.fi
PGReserveSemaphores(int maxSemas)
{
struct stat statbuf;
+ bool found;
/*
* We use the data directory's inode number to seed the search for free
#else
sharedSemas = (PGSemaphore)
- ShmemAlloc(PGSemaphoreShmemSize(maxSemas));
+ ShmemInitStruct("Semaphores", PGSemaphoreShmemSize(maxSemas), &found);
+ Assert(!found);
#endif
numSems = 0;
PGReserveSemaphores(int maxSemas)
{
struct stat statbuf;
+ bool found;
/*
* We use the data directory's inode number to seed the search for free
DataDir)));
sharedSemas = (PGSemaphore)
- ShmemAlloc(PGSemaphoreShmemSize(maxSemas));
+ ShmemInitStruct("Semaphores", PGSemaphoreShmemSize(maxSemas), &found);
+ Assert(!found);
+
numSharedSemas = 0;
maxSharedSemas = maxSemas;