Skip to content

Commit

Permalink
Revert "Fixed non-debug build warning"
Browse files Browse the repository at this point in the history
This reverts commit e1a96b8.
  • Loading branch information
apolcyn committed May 6, 2019
1 parent b7c6ef0 commit 0562b51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/core/lib/gpr/alloc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 2 additions & 2 deletions src/core/lib/gprpp/arena.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 0562b51

Please sign in to comment.