mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-26 07:30:54 +00:00
Replace log2 by implementing Log2 in options_builder
Summary: log2 function is only used in options_builder, and this function is not available under certain platform such as android. This patch implements Log2 by log(n) / log(2). Test Plan: make
This commit is contained in:
parent
274ba62707
commit
9d5019327b
|
@ -11,6 +11,10 @@ namespace rocksdb {
|
|||
|
||||
namespace {
|
||||
|
||||
double Log2(double n) {
|
||||
return log(n) / log(2);
|
||||
}
|
||||
|
||||
// For now, always use 1-0 as level bytes multiplier.
|
||||
const int kBytesForLevelMultiplier = 10;
|
||||
const size_t kBytesForOneMb = 1024 * 1024;
|
||||
|
@ -28,7 +32,7 @@ CompactionStyle PickCompactionStyle(size_t write_buffer_size,
|
|||
::log(target_db_size / write_buffer_size) / ::log(kBytesForLevelMultiplier)));
|
||||
|
||||
int expected_max_files_universal =
|
||||
static_cast<int>(ceil(log2(target_db_size / write_buffer_size)));
|
||||
static_cast<int>(ceil(Log2(target_db_size / write_buffer_size)));
|
||||
|
||||
const int kEstimatedLevel0FilesInLevelStyle = 2;
|
||||
// Estimate write amplification:
|
||||
|
|
Loading…
Reference in a new issue