On Sat, Feb 21, 2015 at 10:16 AM, Alvaro Herrera <alvhe...@2ndquadrant.com> wrote: > Tom Lane wrote: > >> A relevant technique that's been used in a lot of our code is to define >> an intermediate macro, along the lines of >> >> #define SizeofHeapTupleHeader offsetof(HeapTupleHeaderData, t_bits) >> >> or maybe it would better be called HeapTupleHeaderFixedSize or >> HeapTupleHeaderOverhead. Not sure what reads most nicely. > > Maybe the macro could take an argument which is the size of the data > part, so that it could be allocated together with the Overhead part; the > addition would be done in the macro rather than its caller.
I think that we would be just fine with SizeofHeapTupleHeader, a notation with a suffix of the type FixedSize or Overhead is not something used in any of the existing #define of src/include using offsetof(). My 2c. -- Michael -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers