|
|
@ -122,8 +122,8 @@ typedef struct InvalidationChunk |
|
|
|
struct InvalidationChunk *next; /* list link */ |
|
|
|
struct InvalidationChunk *next; /* list link */ |
|
|
|
int nitems; /* # items currently stored in chunk */ |
|
|
|
int nitems; /* # items currently stored in chunk */ |
|
|
|
int maxitems; /* size of allocated array in this chunk */ |
|
|
|
int maxitems; /* size of allocated array in this chunk */ |
|
|
|
SharedInvalidationMessage msgs[1]; /* VARIABLE LENGTH ARRAY */ |
|
|
|
SharedInvalidationMessage msgs[FLEXIBLE_ARRAY_MEMBER]; |
|
|
|
} InvalidationChunk; /* VARIABLE LENGTH STRUCTURE */ |
|
|
|
} InvalidationChunk; |
|
|
|
|
|
|
|
|
|
|
|
typedef struct InvalidationListHeader |
|
|
|
typedef struct InvalidationListHeader |
|
|
|
{ |
|
|
|
{ |
|
|
@ -225,8 +225,8 @@ AddInvalidationMessage(InvalidationChunk **listHdr, |
|
|
|
#define FIRSTCHUNKSIZE 32 |
|
|
|
#define FIRSTCHUNKSIZE 32 |
|
|
|
chunk = (InvalidationChunk *) |
|
|
|
chunk = (InvalidationChunk *) |
|
|
|
MemoryContextAlloc(CurTransactionContext, |
|
|
|
MemoryContextAlloc(CurTransactionContext, |
|
|
|
sizeof(InvalidationChunk) + |
|
|
|
offsetof(InvalidationChunk, msgs) + |
|
|
|
(FIRSTCHUNKSIZE - 1) *sizeof(SharedInvalidationMessage)); |
|
|
|
FIRSTCHUNKSIZE * sizeof(SharedInvalidationMessage)); |
|
|
|
chunk->nitems = 0; |
|
|
|
chunk->nitems = 0; |
|
|
|
chunk->maxitems = FIRSTCHUNKSIZE; |
|
|
|
chunk->maxitems = FIRSTCHUNKSIZE; |
|
|
|
chunk->next = *listHdr; |
|
|
|
chunk->next = *listHdr; |
|
|
@ -239,8 +239,8 @@ AddInvalidationMessage(InvalidationChunk **listHdr, |
|
|
|
|
|
|
|
|
|
|
|
chunk = (InvalidationChunk *) |
|
|
|
chunk = (InvalidationChunk *) |
|
|
|
MemoryContextAlloc(CurTransactionContext, |
|
|
|
MemoryContextAlloc(CurTransactionContext, |
|
|
|
sizeof(InvalidationChunk) + |
|
|
|
offsetof(InvalidationChunk, msgs) + |
|
|
|
(chunksize - 1) *sizeof(SharedInvalidationMessage)); |
|
|
|
chunksize * sizeof(SharedInvalidationMessage)); |
|
|
|
chunk->nitems = 0; |
|
|
|
chunk->nitems = 0; |
|
|
|
chunk->maxitems = chunksize; |
|
|
|
chunk->maxitems = chunksize; |
|
|
|
chunk->next = *listHdr; |
|
|
|
chunk->next = *listHdr; |
|
|
|