aboutsummaryrefslogtreecommitdiff
path: root/src/include/access/htup_details.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/access/htup_details.h')
-rw-r--r--src/include/access/htup_details.h12
1 files changed, 8 insertions, 4 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