postgresql/src/backend
Nathan Bossart 8eef2df189 Fix some rounding code for shared memory.
InitializeShmemGUCs() always added 1 to the value calculated for
shared_memory_size_in_huge_pages, which is unnecessary if the
shared memory size is divisible by the huge page size.

CreateAnonymousSegment() neglected to check for overflow when
rounding up to a multiple of the huge page size.

These are arguably bugs, but they seem extremely unlikely to be
causing problems in practice, so no back-patch.

Author: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CAO6_Xqq2vZbva0R9eQSY0p2kfksX2aP4r%3D%2BZ_q1HBYNU%3Dm8bBg%40mail.gmail.com
2026-01-23 10:46:49 -06:00
..
access Make some use of anonymous unions [reloptions] 2026-01-22 17:04:59 +01:00
archive Update copyright for 2026 2026-01-01 13:24:10 -05:00
backup Don't set the truncation block length greater than RELSEG_SIZE. 2026-01-19 12:09:32 -05:00
bootstrap Add data type oid8, 64-bit unsigned identifier 2026-01-07 11:37:00 +09:00
catalog Record range constructor functions in pg_range 2026-01-22 15:56:29 +01:00
commands Record range constructor functions in pg_range 2026-01-22 15:56:29 +01:00
executor Fix bogus ctid requirement for dummy-root partitioned targets 2026-01-23 10:23:30 +09:00
foreign Update copyright for 2026 2026-01-01 13:24:10 -05:00
jit jit: Add missing inline pass for LLVM >= 17. 2026-01-22 16:03:47 +13:00
lib Remove #include <math.h> where not needed 2026-01-15 19:09:47 +01:00
libpq Update copyright for 2026 2026-01-01 13:24:10 -05:00
main Update copyright for 2026 2026-01-01 13:24:10 -05:00
nodes Remove #include <math.h> where not needed 2026-01-15 19:09:47 +01:00
optimizer Remove useless flag PVC_INCLUDE_CONVERTROWTYPES. 2026-01-21 13:26:19 -05:00
parser Force standard_conforming_strings to always be ON. 2026-01-21 15:08:38 -05:00
partitioning Fix typos and inconsistencies in code and comments 2026-01-05 09:19:15 +09:00
po Update copyright for 2026 2026-01-01 13:24:10 -05:00
port Fix some rounding code for shared memory. 2026-01-23 10:46:49 -06:00
postmaster Use integer backend type when exec'ing a postmaster child 2026-01-20 16:41:04 +01:00
regex Update copyright for 2026 2026-01-01 13:24:10 -05:00
replication Add WALRCV_CONNECTING state to the WAL receiver 2026-01-23 14:17:28 +09:00
rewrite Update copyright for 2026 2026-01-01 13:24:10 -05:00
snowball Fix meson build of snowball code. 2026-01-05 16:51:36 -05:00
statistics Add routine to free MCVList 2026-01-20 13:13:47 +09:00
storage Fix some rounding code for shared memory. 2026-01-23 10:46:49 -06:00
tcop Fix misc typos, mostly in comments 2026-01-08 18:10:08 +02:00
tsearch Avoid casting void * function arguments 2026-01-12 16:12:56 +01:00
utils Mark commented out code as unused 2026-01-22 12:44:07 +01:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
Makefile Remove more leftovers of AIX support 2026-01-21 14:51:05 +01:00
meson.build meson: Rename cpp variable to cxx 2026-01-09 08:58:23 +01:00
nls.mk Create a separate file listing backend types 2025-09-26 15:21:49 +02:00