Skip to content

Commit 01ed59a

Browse files
Use SDK leveldb environment (#1192)
When the max cache size is not set, SDK use the leveldb default env, SDK need to replace it with it's own in order to disable mmap usage. Fix the Limiter class constructor warning. Relates-To: OLPSUP-13838 Signed-off-by: Mykhailo Kuchma <[email protected]>
1 parent b7caabc commit 01ed59a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

olp-cpp-sdk-core/src/cache/DiskCache.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ OpenResult DiskCache::Open(const std::string& data_path,
187187
DiskCacheEnv::Env(), versioned_data_path,
188188
settings.enforce_immediate_flush);
189189
open_options.env = environment_.get();
190+
} else {
191+
open_options.env = DiskCacheEnv::Env();
190192
}
191193
} else {
192194
environment_ = std::make_unique<ReadOnlyEnv>(DiskCacheEnv::Env());

olp-cpp-sdk-core/src/cache/DiskCacheEnv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ int MaxOpenFiles() {
6565
class Limiter {
6666
public:
6767
// Limit maximum number of resources to |max_acquires|.
68-
Limiter(int max_acquires) : acquires_allowed_(max_acquires) {}
68+
explicit Limiter(int max_acquires) : acquires_allowed_(max_acquires) {}
6969

7070
Limiter(const Limiter&) = delete;
7171
Limiter operator=(const Limiter&) = delete;

0 commit comments

Comments
 (0)