Re: Portability issues in shm_mq

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Portability issues in shm_mq
Date: 2014-03-18 03:09:29
Message-ID: 17076.1395112169@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> OK, I tried this out. The major complication that cropped up was
> that, if we make the length word always a Size but align the buffer to
> MAXIMUM_ALIGNOF, then the length word might get split if sizeof(Size)
> > MAXIMUM_ALIGNOF.

Hmm ... do we support any platforms where that's actually the case?
It's possible I guess but I don't know of any offhand. The reverse
case is real, but I'm not sure about this one.

> That doesn't look too bad, but required changing a
> couple of if statements into while loops, and changing around the
> structure of a shm_mq_handle a bit. See attached.

Would it get noticeably simpler or faster if you omitted support for
the sizeof(Size) > MAXIMUM_ALIGNOF case? It looks like perhaps not,
but if we were paying anything much I'd be tempted to just put in
a static assert to the contrary and see if anyone complains.

BTW, can't we drop the MAXALIGN64 stuff again?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Johnston 2014-03-18 03:12:58 Re: Minimum supported version of Python?
Previous Message Tom Lane 2014-03-18 02:55:18 Re: Minimum supported version of Python?