Revert "Fixed non-debug build warning"

This reverts commit e1a96b8347.
pull/18966/head
Alexander Polcyn 6 years ago
parent b7c6ef0225
commit 0562b51f8e
  1. 2
      src/core/lib/gpr/alloc.cc
  2. 4
      src/core/lib/gprpp/arena.cc

@ -34,14 +34,12 @@ static void* zalloc_with_gpr_malloc(size_t sz) {
return p;
}
#ifndef NDEBUG
static constexpr bool is_power_of_two(size_t value) {
// 2^N = 100000...000
// 2^N - 1 = 011111...111
// (2^N) && ((2^N)-1)) = 0
return (value & (value - 1)) == 0;
}
#endif
static void* aligned_alloc_with_gpr_malloc(size_t size, size_t alignment) {
GPR_DEBUG_ASSERT(is_power_of_two(alignment));

@ -35,8 +35,8 @@ namespace {
void* ArenaStorage(size_t initial_size) {
static constexpr size_t base_size =
GPR_ROUND_UP_TO_MAX_ALIGNMENT_SIZE(sizeof(grpc_core::Arena));
initial_size = GPR_ROUND_UP_TO_MAX_ALIGNMENT_SIZE(initial_size);
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(sizeof(grpc_core::Arena));
initial_size = GPR_ROUND_UP_TO_ALIGNMENT_SIZE(initial_size);
size_t alloc_size = base_size + initial_size;
static constexpr size_t alignment =
(GPR_CACHELINE_SIZE > GPR_MAX_ALIGNMENT &&

Loading…
Cancel
Save