diff options
Diffstat (limited to 'src/core/support/stack_lockfree.c')
-rw-r--r-- | src/core/support/stack_lockfree.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/core/support/stack_lockfree.c b/src/core/support/stack_lockfree.c index bc741f8c70..27ecf62280 100644 --- a/src/core/support/stack_lockfree.c +++ b/src/core/support/stack_lockfree.c @@ -67,7 +67,7 @@ typedef union lockfree_node { #define ENTRY_ALIGNMENT_BITS 3 /* make sure that entries aligned to 8-bytes */ #define INVALID_ENTRY_INDEX \ ((1 << 16) - 1) /* reserve this entry as invalid \ - */ + */ struct gpr_stack_lockfree { lockfree_node *entries; @@ -75,7 +75,7 @@ struct gpr_stack_lockfree { #ifndef NDEBUG /* Bitmap of pushed entries to check for double-push or pop */ - gpr_atm pushed[(INVALID_ENTRY_INDEX+1)/(8*sizeof(gpr_atm))]; + gpr_atm pushed[(INVALID_ENTRY_INDEX + 1) / (8 * sizeof(gpr_atm))]; #endif }; @@ -123,13 +123,13 @@ int gpr_stack_lockfree_push(gpr_stack_lockfree *stack, int entry) { #ifndef NDEBUG /* Check for double push */ { - int pushed_index = entry / (8*sizeof(gpr_atm)); - int pushed_bit = entry % (8*sizeof(gpr_atm)); + int pushed_index = entry / (8 * sizeof(gpr_atm)); + int pushed_bit = entry % (8 * sizeof(gpr_atm)); gpr_atm old_val; old_val = gpr_atm_no_barrier_fetch_add(&stack->pushed[pushed_index], - (gpr_atm)(1UL << pushed_bit)); - GPR_ASSERT((old_val & (1UL<<pushed_bit)) == 0); + (gpr_atm)(1UL << pushed_bit)); + GPR_ASSERT((old_val & (1UL << pushed_bit)) == 0); } #endif @@ -161,13 +161,13 @@ int gpr_stack_lockfree_pop(gpr_stack_lockfree *stack) { #ifndef NDEBUG /* Check for valid pop */ { - int pushed_index = head.contents.index / (8*sizeof(gpr_atm)); - int pushed_bit = head.contents.index % (8*sizeof(gpr_atm)); + int pushed_index = head.contents.index / (8 * sizeof(gpr_atm)); + int pushed_bit = head.contents.index % (8 * sizeof(gpr_atm)); gpr_atm old_val; old_val = gpr_atm_no_barrier_fetch_add(&stack->pushed[pushed_index], - -(gpr_atm)(1UL << pushed_bit)); - GPR_ASSERT((old_val & (1UL<<pushed_bit)) != 0); + -(gpr_atm)(1UL << pushed_bit)); + GPR_ASSERT((old_val & (1UL << pushed_bit)) != 0); } #endif |