diff options
author | Craig Tiller <ctiller@google.com> | 2017-04-20 15:47:23 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-04-20 15:47:23 -0700 |
commit | cdd9e568641985e25adf4b0b1977e2a53295f77e (patch) | |
tree | 9a8a031d0f4b07482a32f117e230b649c19112ea /src/core/lib/support/stack_lockfree.c | |
parent | f5a1b750655496d044024c6aaff55c87e7915b2b (diff) |
C++ compatibility fix for stack_lockfree.c
Diffstat (limited to 'src/core/lib/support/stack_lockfree.c')
-rw-r--r-- | src/core/lib/support/stack_lockfree.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/lib/support/stack_lockfree.c b/src/core/lib/support/stack_lockfree.c index c481a3e0dc..dfbd3fb125 100644 --- a/src/core/lib/support/stack_lockfree.c +++ b/src/core/lib/support/stack_lockfree.c @@ -76,13 +76,13 @@ struct gpr_stack_lockfree { gpr_stack_lockfree *gpr_stack_lockfree_create(size_t entries) { gpr_stack_lockfree *stack; - stack = gpr_malloc(sizeof(*stack)); + stack = (gpr_stack_lockfree *)gpr_malloc(sizeof(*stack)); /* Since we only allocate 16 bits to represent an entry number, * make sure that we are within the desired range */ /* Reserve the highest entry number as a dummy */ GPR_ASSERT(entries < INVALID_ENTRY_INDEX); - stack->entries = gpr_malloc_aligned(entries * sizeof(stack->entries[0]), - ENTRY_ALIGNMENT_BITS); + stack->entries = (lockfree_node *)gpr_malloc_aligned( + entries * sizeof(stack->entries[0]), ENTRY_ALIGNMENT_BITS); /* Clear out all entries */ memset(stack->entries, 0, entries * sizeof(stack->entries[0])); memset(&stack->head, 0, sizeof(stack->head)); |