File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11cmake_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
44set (CMAKE_CXX_STANDARD 17)
55set (CMAKE_CXX_STANDARD_REQUIRED ON )
Original file line number Diff line number Diff 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/* *
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments