aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-06-05 14:50:52 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-06-05 14:50:59 -0400
commit3e60c6f72328a9ad14d8a087411cd394752c5b23 (patch)
tree5098f3109c3a1669278df7239cd2faebedaec84e /src/backend/tcop/postgres.c
parent614350a3ab73992f48c86e26552a2cbf030180e2 (diff)
downloadpostgresql-3e60c6f72328a9ad14d8a087411cd394752c5b23.tar.gz
postgresql-3e60c6f72328a9ad14d8a087411cd394752c5b23.zip
Code review for shm_toc.h/.c.
Declare the toc_nentry field as uint32 not Size. Since shm_toc_lookup() reads the field without any lock, it has to be atomically readable, and we do not assume that for fields wider than 32 bits. Performance would be impossibly bad for entry counts approaching 2^32 anyway, so there is no need to try to preserve maximum width here. This is probably an academic issue, because even if reading int64 isn't atomic, the high order half would never change in practice. Still, it's a coding rule violation, so let's fix it. Adjust some other not-terribly-well-chosen data types too, and copy-edit some comments. Make shm_toc_attach's Asserts consistent with shm_toc_create's. None of this looks to be a live bug, so no need for back-patch. Discussion: https://postgr.es/m/16984.1496679541@sss.pgh.pa.us
Diffstat (limited to 'src/backend/tcop/postgres.c')
0 files changed, 0 insertions, 0 deletions