diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-02-21 16:12:14 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-02-21 16:12:14 -0500 |
commit | 2e211211a76782b6084194a5ced94c0795460047 (patch) | |
tree | f98c4ff74b421ecb675e5192c0c1759546d22a86 /src/backend/storage/ipc/sinvaladt.c | |
parent | e1a11d93111ff3fba7a91f3f2ac0b0aca16909a8 (diff) | |
download | postgresql-2e211211a76782b6084194a5ced94c0795460047.tar.gz postgresql-2e211211a76782b6084194a5ced94c0795460047.zip |
Use FLEXIBLE_ARRAY_MEMBER in a number of other places.
I think we're about done with this...
Diffstat (limited to 'src/backend/storage/ipc/sinvaladt.c')
-rw-r--r-- | src/backend/storage/ipc/sinvaladt.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/backend/storage/ipc/sinvaladt.c b/src/backend/storage/ipc/sinvaladt.c index bb3e604e671..81b85c0e420 100644 --- a/src/backend/storage/ipc/sinvaladt.c +++ b/src/backend/storage/ipc/sinvaladt.c @@ -184,12 +184,9 @@ typedef struct SISeg SharedInvalidationMessage buffer[MAXNUMMESSAGES]; /* - * Per-backend state info. - * - * We declare procState as 1 entry because C wants a fixed-size array, but - * actually it is maxBackends entries long. + * Per-backend invalidation state info (has MaxBackends entries). */ - ProcState procState[1]; /* reflects the invalidation state */ + ProcState procState[FLEXIBLE_ARRAY_MEMBER]; } SISeg; static SISeg *shmInvalBuffer; /* pointer to the shared inval buffer */ @@ -221,16 +218,12 @@ SInvalShmemSize(void) void CreateSharedInvalidationState(void) { - Size size; int i; bool found; /* Allocate space in shared memory */ - size = offsetof(SISeg, procState); - size = add_size(size, mul_size(sizeof(ProcState), MaxBackends)); - shmInvalBuffer = (SISeg *) - ShmemInitStruct("shmInvalBuffer", size, &found); + ShmemInitStruct("shmInvalBuffer", SInvalShmemSize(), &found); if (found) return; |