Adjust Valgrind macro usage to protect chunk headers
authorDavid Rowley <drowley@postgresql.org>
Fri, 14 Apr 2023 23:59:52 +0000 (11:59 +1200)
committerDavid Rowley <drowley@postgresql.org>
Fri, 14 Apr 2023 23:59:52 +0000 (11:59 +1200)
commit414d66220adb9189951fb4d410470f9f36f9cbd1
tree490cba40579f26eeb3738e133c29df22a8017e46
parent43a33ef54e503b61f269d088f2623ba3b9484ad7
Adjust Valgrind macro usage to protect chunk headers

Prior to this commit we only ever protected MemoryChunk's requested_size
field with Valgrind NOACCESS.  This means that if the hdrmask field is
ever accessed accidentally then we're not going to get any warnings from
Valgrind about it.  Valgrind would have warned us about the problem fixed
in 92957ed98 had we already been doing this.

Per suggestion from Tom Lane

Reviewed-by: Richard Guo
Discussion: https://postgr.es/m/1650235.1672694719@sss.pgh.pa.us
Discussion: https://postgr.es/m/CAApHDvr=FZNGbj252Z6M9BSFKoq6BMxgkQ2yEAGUYoo7RquqZg@mail.gmail.com
src/backend/utils/mmgr/alignedalloc.c
src/backend/utils/mmgr/aset.c
src/backend/utils/mmgr/generation.c
src/backend/utils/mmgr/mcxt.c
src/backend/utils/mmgr/slab.c