Skip to content

Commit c658748

Browse files
authored
Merge pull request #43 from tidesdb/2-3-4
2 3 4
2 parents a3e01a9 + e44513a commit c658748

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.16)
2-
project(tidesdb_cpp VERSION 2.3.3 LANGUAGES CXX)
2+
project(tidesdb_cpp VERSION 2.3.4 LANGUAGES CXX)
33

44
set(CMAKE_CXX_STANDARD 17)
55
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include/tidesdb/tidesdb.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ struct Config
230230
std::size_t maxOpenSSTables = 256;
231231
bool logToFile = false;
232232
std::size_t logTruncationAt = 24 * 1024 * 1024;
233+
std::size_t maxMemoryUsage = 0; ///< Global memory limit in bytes (0 = auto)
233234
};
234235

235236
/**

src/tidesdb.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ TidesDB::TidesDB(const Config& config)
602602
cConfig.max_open_sstables = config.maxOpenSSTables;
603603
cConfig.log_to_file = config.logToFile ? 1 : 0;
604604
cConfig.log_truncation_at = config.logTruncationAt;
605+
cConfig.max_memory_usage = config.maxMemoryUsage;
605606

606607
int result = tidesdb_open(&cConfig, &db_);
607608
checkResult(result, "failed to open database");
@@ -800,6 +801,7 @@ Config TidesDB::defaultConfig()
800801
config.maxOpenSSTables = cConfig.max_open_sstables;
801802
config.logToFile = cConfig.log_to_file != 0;
802803
config.logTruncationAt = cConfig.log_truncation_at;
804+
config.maxMemoryUsage = cConfig.max_memory_usage;
803805

804806
return config;
805807
}

0 commit comments

Comments
 (0)