summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-11-24 13:43:34 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2017-11-24 13:43:34 -0500
commitcc3c4af4a948e5c5be22afe769bab41235c574e5 (patch)
tree4ef00981989a8859c063dc3bed0c6c4b901ff69e
parent9c55391f0f277318c754f89950e65363ede4136e (diff)
Fix bug in generation.c's valgrind support.
This doesn't look like the last such bug, but it's one that the test_decoding regression test is tripping over. Per buildfarm. Tomas Vondra Discussion: https://postgr.es/m/c903f275-2150-fa52-64bf-dca7b53ebf8d@fuzzy.cz
-rw-r--r--src/backend/utils/mmgr/generation.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/backend/utils/mmgr/generation.c b/src/backend/utils/mmgr/generation.c
index 2ede8e1be93..a748ee266c2 100644
--- a/src/backend/utils/mmgr/generation.c
+++ b/src/backend/utils/mmgr/generation.c
@@ -409,9 +409,14 @@ GenerationAlloc(MemoryContext context, Size size)
chunk = (GenerationChunk *) block->freeptr;
+ /* Prepare to initialize the chunk header. */
+ VALGRIND_MAKE_MEM_UNDEFINED(chunk, Generation_CHUNKHDRSZ);
+
block->nchunks += 1;
block->freeptr += (Generation_CHUNKHDRSZ + chunk_size);
+ Assert(block->freeptr <= block->endptr);
+
chunk->block = block;
chunk->context = set;