pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@2ndquadrant.com>
Cc: pgsql-committers@postgresql.org
Cc: Michael Paquier <michael.paquier@gmail.com>
Subject: Re: pgsql: Use FLEXIBLE_ARRAY_MEMBER in a bunch more places.
Date: Fri, 20 Feb 2015 22:16:16 -0300
Message-ID: <20150221011616.GS2500@alvh.no-ip.org> (raw)
In-Reply-To: <21330.1424473164@sss.pgh.pa.us>
References: <E1YOfse-0003eE-Jq@gemulon.postgresql.org>
	<20150220153914.GC12653@awork2.anarazel.de>
	<20150220154255.GD12653@awork2.anarazel.de>
	<21330.1424473164@sss.pgh.pa.us>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

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.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



view thread (9+ messages)  latest in thread

Message-ID: <20150221011616.GS2500@alvh.no-ip.org>
Permalink:  ../20150221011616.GS2500@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20150221011616.GS2500@alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, andres@2ndquadrant.com, michael.paquier@gmail.com
  Subject: Re: pgsql: Use FLEXIBLE_ARRAY_MEMBER in a bunch more places.
  In-Reply-To: <20150221011616.GS2500@alvh.no-ip.org>
  References: <E1YOfse-0003eE-Jq@gemulon.postgresql.org> <20150220153914.GC12653@awork2.anarazel.de> <20150220154255.GD12653@awork2.anarazel.de> <21330.1424473164@sss.pgh.pa.us> <20150221011616.GS2500@alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox