Skip to content

Commit

Permalink
Fixed a compile error in util/options_builder.cc
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yhchiang committed Jul 23, 2014
1 parent 0e1b478 commit 00f56df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/options_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 00f56df

Please sign in to comment.