diff options
Diffstat (limited to 'src/include/access')
| -rw-r--r-- | src/include/access/htup_details.h | 12 | ||||
| -rw-r--r-- | src/include/access/tuptoaster.h | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/include/access/htup_details.h b/src/include/access/htup_details.h index d2ad910a333..0a673cd5267 100644 --- a/src/include/access/htup_details.h +++ b/src/include/access/htup_details.h @@ -150,13 +150,15 @@ struct HeapTupleHeaderData /* ^ - 23 bytes - ^ */ - bits8 t_bits[1]; /* bitmap of NULLs -- VARIABLE LENGTH */ + bits8 t_bits[FLEXIBLE_ARRAY_MEMBER]; /* bitmap of NULLs */ /* MORE DATA FOLLOWS AT END OF STRUCT */ }; /* typedef appears in tupbasics.h */ +#define SizeofHeapTupleHeader offsetof(HeapTupleHeaderData, t_bits) + /* * information stored in t_infomask: */ @@ -498,7 +500,7 @@ do { \ * you can, say, fit 2 tuples of size MaxHeapTupleSize/2 on the same page. */ #define MaxHeapTupleSize (BLCKSZ - MAXALIGN(SizeOfPageHeaderData + sizeof(ItemIdData))) -#define MinHeapTupleSize MAXALIGN(offsetof(HeapTupleHeaderData, t_bits)) +#define MinHeapTupleSize MAXALIGN(SizeofHeapTupleHeader) /* * MaxHeapTuplesPerPage is an upper bound on the number of tuples that can @@ -513,7 +515,7 @@ do { \ */ #define MaxHeapTuplesPerPage \ ((int) ((BLCKSZ - SizeOfPageHeaderData) / \ - (MAXALIGN(offsetof(HeapTupleHeaderData, t_bits)) + sizeof(ItemIdData)))) + (MAXALIGN(SizeofHeapTupleHeader) + sizeof(ItemIdData)))) /* * MaxAttrSize is a somewhat arbitrary upper limit on the declared size of @@ -579,13 +581,15 @@ struct MinimalTupleData /* ^ - 23 bytes - ^ */ - bits8 t_bits[1]; /* bitmap of NULLs -- VARIABLE LENGTH */ + bits8 t_bits[FLEXIBLE_ARRAY_MEMBER]; /* bitmap of NULLs */ /* MORE DATA FOLLOWS AT END OF STRUCT */ }; /* typedef appears in htup.h */ +#define SizeofMinimalTupleHeader offsetof(MinimalTupleData, t_bits) + /* * GETSTRUCT - given a HeapTuple pointer, return address of the user data diff --git a/src/include/access/tuptoaster.h b/src/include/access/tuptoaster.h index 331dd259ccb..7d185357714 100644 --- a/src/include/access/tuptoaster.h +++ b/src/include/access/tuptoaster.h @@ -90,7 +90,7 @@ #define TOAST_MAX_CHUNK_SIZE \ (EXTERN_TUPLE_MAX_SIZE - \ - MAXALIGN(offsetof(HeapTupleHeaderData, t_bits)) - \ + MAXALIGN(SizeofHeapTupleHeader) - \ sizeof(Oid) - \ sizeof(int32) - \ VARHDRSZ) |
