From 00f56dfa28d703b251b6bcf4d8f39ee06612be68 Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang Date: Wed, 23 Jul 2014 10:31:32 -0700 Subject: [PATCH] Fixed a compile error in util/options_builder.cc Summary: Fixed the following compile error by replacing pow by shift, as it computes power of 2. util/options_builder.cc:133:14: error: no member named 'pow' in namespace 'std' std::pow(2, std::max(0, std::min(3, level0_stop_writes_trigger - ~~~~~^ 1 error generated. make: *** [util/options_builder.o] Error 1 Test Plan: make success in mac and linux Reviewers: ljin, igor, sdong Reviewed By: sdong Subscribers: leveldb Differential Revision: https://reviews.facebook.net/D20475 --- util/options_builder.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/options_builder.cc b/util/options_builder.cc index 5796c9856..4035b2e65 100644 --- a/util/options_builder.cc +++ b/util/options_builder.cc @@ -130,8 +130,8 @@ void OptimizeForLevel(int read_amplification_threshold, // Try to enlarge the buffer up to 1GB, if still have sufficient headroom. file_num_buffer *= - std::pow(2, std::max(0, std::min(3, level0_stop_writes_trigger - - file_num_buffer - 2))); + 1 << std::max(0, std::min(3, level0_stop_writes_trigger - + file_num_buffer - 2)); options->level0_stop_writes_trigger = level0_stop_writes_trigger; options->level0_slowdown_writes_trigger = level0_stop_writes_trigger - 2;