Re: Portability issues in shm_mq - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Portability issues in shm_mq
Date
Msg-id 17076.1395112169@sss.pgh.pa.us
Whole thread Raw
In response to Re: Portability issues in shm_mq  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Portability issues in shm_mq  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Minimum supported version of Python?
Next
From: David Johnston
Date:
Subject: Re: Minimum supported version of Python?