From 6b72834c8aa215e90e8f4d47bbe4e4a65521b8c8 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 23 Sep 2016 08:44:43 -0700 Subject: [PATCH] Compilation, initialization fixes --- src/core/lib/iomgr/buffer_pool.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/lib/iomgr/buffer_pool.c b/src/core/lib/iomgr/buffer_pool.c index 46dd6d9ce1c..d2464ff0799 100644 --- a/src/core/lib/iomgr/buffer_pool.c +++ b/src/core/lib/iomgr/buffer_pool.c @@ -321,6 +321,8 @@ grpc_buffer_pool *grpc_buffer_pool_create(void) { buffer_pool->combiner = grpc_combiner_create(NULL); buffer_pool->free_pool = INT64_MAX; buffer_pool->size = INT64_MAX; + buffer_pool->step_scheduled = false; + buffer_pool->reclaiming = false; grpc_closure_init(&buffer_pool->bpstep_closure, bpstep, buffer_pool); grpc_closure_init(&buffer_pool->bpreclaimation_done_closure, bpreclaimation_done_closure, buffer_pool); @@ -404,8 +406,8 @@ void grpc_buffer_user_alloc(grpc_exec_ctx *exec_ctx, grpc_buffer_user *buffer_user, size_t size, grpc_closure *optional_on_done) { gpr_mu_lock(&buffer_user->mu); - buffer_user->allocated += size; - buffer_user->free_pool -= size; + buffer_user->allocated += (int64_t)size; + buffer_user->free_pool -= (int64_t)size; if (buffer_user->free_pool < 0) { grpc_closure_list_append(&buffer_user->on_allocated, optional_on_done, GRPC_ERROR_NONE); @@ -426,8 +428,8 @@ void grpc_buffer_user_free(grpc_exec_ctx *exec_ctx, gpr_mu_lock(&buffer_user->mu); GPR_ASSERT(buffer_user->allocated >= (int64_t)size); bool was_zero_or_negative = buffer_user->free_pool <= 0; - buffer_user->free_pool += size; - buffer_user->allocated -= size; + buffer_user->free_pool += (int64_t)size; + buffer_user->allocated -= (int64_t)size; bool is_bigger_than_zero = buffer_user->free_pool > 0; if (is_bigger_than_zero && was_zero_or_negative && !buffer_user->added_to_free_pool) {