aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-04-21 15:40:43 -0700
committerGravatar GitHub <noreply@github.com>2017-04-21 15:40:43 -0700
commit9c1dd5c9e58d56debf4da29c8c6175370b534994 (patch)
tree3f04f2a9927b43ceb2ed9fba5b926b6ba0f47d89 /src/core
parent401aa08915b427c03a5616e79127cc0f882bdd8a (diff)
parentf18f30e76017619b50a325ca3469c372c5fd387d (diff)
Merge pull request #10779 from ctiller/c++compat2
C++ compatibility fix for stack_lockfree.c
Diffstat (limited to 'src/core')
-rw-r--r--src/core/lib/support/stack_lockfree.c6
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));