postgresql/src/backend
Tom Lane 3e60c6f723 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
2017-06-05 14:50:59 -04:00
..
access Don't be so trusting that shm_toc_lookup() will always succeed. 2017-06-05 12:05:42 -04:00
bootstrap Disallow CREATE INDEX if table is already in use in current session. 2017-06-04 12:02:41 -04:00
catalog Replace over-optimistic Assert in partitioning code with a runtime test. 2017-06-04 16:20:03 -04:00
commands Replace over-optimistic Assert in partitioning code with a runtime test. 2017-06-04 16:20:03 -04:00
executor Don't be so trusting that shm_toc_lookup() will always succeed. 2017-06-05 12:05:42 -04:00
foreign Abstract logic to allow for multiple kinds of child rels. 2017-04-03 22:41:31 -04:00
lib Post-PG 10 beta1 pgindent run 2017-05-17 16:31:56 -04:00
libpq Abort authentication if the client selected an invalid SASL mechanism. 2017-05-25 08:50:47 -04:00
main Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
nodes Fix omission of locations in outfuncs/readfuncs partitioning node support. 2017-05-30 11:32:41 -04:00
optimizer #ifdef out assorted unused GEQO code. 2017-06-04 13:34:05 -04:00
parser Allow NumericOnly to be "+ FCONST". 2017-05-29 15:19:07 -04:00
po Translation updates 2017-05-15 12:19:54 -04:00
port Post-PG 10 beta1 pgindent run 2017-05-17 16:31:56 -04:00
postmaster Post-PG 10 beta1 pgindent run 2017-05-17 16:31:56 -04:00
regex Fix regexport.c to behave sanely with lookaround constraints. 2017-04-13 17:18:35 -04:00
replication Fix typo in error message. 2017-06-05 11:38:26 +03:00
rewrite Post-PG 10 beta1 pgindent run 2017-05-17 16:31:56 -04:00
snowball Add ICU_FLAGS to one more place 2017-03-23 16:53:10 -04:00
statistics Post-PG 10 beta1 pgindent run 2017-05-17 16:31:56 -04:00
storage Code review for shm_toc.h/.c. 2017-06-05 14:50:59 -04:00
tcop Disallow CREATE INDEX if table is already in use in current session. 2017-06-04 12:02:41 -04:00
tsearch Post-PG 10 beta1 pgindent run 2017-05-17 16:31:56 -04:00
utils Replace over-optimistic Assert in partitioning code with a runtime test. 2017-06-04 16:20:03 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk ICU support 2017-03-23 15:28:48 -04:00
Makefile Implement multivariate n-distinct coefficients 2017-03-24 14:06:10 -03:00
nls.mk Translation updates 2017-05-15 12:19:54 -04:00