pgsql: TYPEALIGN doesn't work on int64 on 32-bit platforms. - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: TYPEALIGN doesn't work on int64 on 32-bit platforms.
Date
Msg-id E1VTJsF-00073z-Lv@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
TYPEALIGN doesn't work on int64 on 32-bit platforms.

The TYPEALIGN macro, and the related ones like MAXALIGN, don't work with
values larger than intptr_t, because TYPEALIGN casts the argument to
intptr_t to do the arithmetic. That's not a problem when dealing with
pointers or lengths or offsets related to pointers, but the XLogInsert
scaling patch added a call to MAXALIGN with an XLogRecPtr argument.

To fix, add wider variants of the macros, called TYPEALIGN64 and MAXALIGN64,
which are just like the existing variants but work with uint64 instead of
intptr_t.

Report and patch by David Rowley, analysis by Andres Freund.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/5962519b362d28ef02bc8ec135b9bf9b9a168263

Modified Files
--------------
src/backend/access/transam/xlog.c |    2 +-
src/include/c.h                   |   12 ++++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: pgsql: Fix bugs in SSI tuple locking.
Next
From: Heikki Linnakangas
Date:
Subject: pgsql: Oops. Unbreak the 9.1 build.