From 663a29144ae01fb421ae84e533852c8423c63452 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Thu, 4 Feb 2016 13:19:50 -0800 Subject: [PATCH] Add explicit comments about purpose of writing to pad --- src/core/support/stack_lockfree.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/support/stack_lockfree.c b/src/core/support/stack_lockfree.c index c18fb65ae65..b2f58803528 100644 --- a/src/core/support/stack_lockfree.c +++ b/src/core/support/stack_lockfree.c @@ -100,6 +100,7 @@ gpr_stack_lockfree *gpr_stack_lockfree_create(size_t entries) { /* Point the head at reserved dummy entry */ stack->head.contents.index = INVALID_ENTRY_INDEX; #ifdef GPR_ARCH_64 + // Fill in the pad to avoid confusing memcheck tools stack->head.contents.pad = 0; #endif stack->head.contents.aba_ctr = 0; @@ -120,6 +121,7 @@ int gpr_stack_lockfree_push(gpr_stack_lockfree *stack, int entry) { /* First fill in the entry's index and aba ctr for new head */ newhead.contents.index = (uint16_t)entry; #ifdef GPR_ARCH_64 + // Fill in the pad to avoid confusing memcheck tools newhead.contents.pad = 0; #endif