postgresql/src/backend/storage
Heikki Linnakangas ac883ac453 Fix shm_toc.c to always return buffer-aligned memory.
Previously, if you passed a non-aligned size to shm_toc_create(), the
memory returned by shm_toc_allocate() would be similarly non-aligned.
This was exposed by commit 3cda10f41b, which allocated structs containing
a pg_atomic_uint64 field with shm_toc_allocate(). On systems with
MAXIMUM_ALIGNOF = 4, such structs still need to be 8-bytes aligned, but
the memory returned by shm_toc_allocate() was only 4-bytes aligned.

It's quite bogus that we abuse BUFFERALIGN to align the structs for
pg_atomic_uint64. It doesn't really have anything to do with buffers. But
that's a separate issue.

This ought to fix the buildfarm failures on 32-bit x86 systems.

Discussion: https://www.postgresql.org/message-id/7e0a73a5-0df9-1859-b8ae-9acf122dc38d@iki.fi
2017-08-16 21:52:38 +03:00
..
buffer Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
file Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
freespace Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
ipc Fix shm_toc.c to always return buffer-aligned memory. 2017-08-16 21:52:38 +03:00
large_object Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
lmgr Fix race condition in predicate-lock init code in EXEC_BACKEND builds. 2017-07-24 16:45:58 -04:00
page Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
smgr Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
Makefile Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00