Add explicit comments about purpose of writing to pad

pull/5081/head
Vijay Pai 9 years ago
parent 07a6be99bd
commit 663a29144a
  1. 2
      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

Loading…
Cancel
Save