On 2015-02-21 15:16:55 -0500, Tom Lane wrote:
> Andres, would you double-check the changes in reorderbuffer.c?
> There were some weird calculations with
> offsetof(ReorderBufferTupleBuf, data) - offsetof(HeapTupleHeaderData, t_bits)
> which Michael simplified in a way that's not 100% equivalent. I think
> it's probably better this way; it looks like the old coding was maybe
> wrong, or at least in the habit of misaligning data. But I might be
> misunderstanding.
Hm, yea, that looks/looked slightly wierd. I think it's actually correct
though: HeapTupleData's t_len include's HeapTupleHeaderData itself and
offsetof(ReorderBufferTupleBuf, data) points to *after*
HeapTupleHeaderData. As this is only the length computation, not the
copy, I don't see an active issue. Why I wrote it that way, instead of
using offsetof(ReorderBufferTupleBuf, header) + t_len - which should be
equivalent - I don't know.
Greetings,
Andres Freund
-- Andres Freund http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services