Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::BlockAllocatorMemorySetting Struct Reference

Public Types

using RETURN_TYPE = string

Static Public Member Functions

static void SetGlobal (DatabaseInstance *db, DBConfig &config, const Value &parameter)
static void ResetGlobal (DatabaseInstance *db, DBConfig &config)
static Value GetSetting (const ClientContext &context)

Static Public Attributes

static constexpr const char * Name = "block_allocator_memory"
static constexpr const char * Description
static constexpr const char * InputType = "VARCHAR"

Member Function Documentation

◆ SetGlobal()

void duckdb::BlockAllocatorMemorySetting::SetGlobal ( DatabaseInstance * db,
DBConfig & config,
const Value & parameter )
static
301613 {
301614 const auto input_string = input.ToString();
301615 idx_t size;
301616 if (!input_string.empty() && input_string.back() == '%') {
301617 double percentage;
301618 if (!TryDoubleCast(input_string.c_str(), input_string.size() - 1, percentage, false) || percentage < 0 ||
301619 percentage > 100) {
301620 throw InvalidInputException("Unable to parse valid percentage (input: %s)", input_string);
301621 }
301622 size = LossyNumericCast<idx_t>(percentage) * config.options.maximum_memory / 100;
301623 } else {
301624 size = DBConfig::ParseMemoryLimit(input_string);
301625 }
301626 if (db) {
301627 BlockAllocator::Get(*db).Resize(size);
301628 }
301630}
GOpaque< Size > size(const GMat &src)
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
idx_t maximum_memory
The maximum memory used by the database system (in bytes). Default: 80% of System available memory.
Definition duckdb.hpp:40000
idx_t block_allocator_size
Physical memory that the block allocator is allowed to use (this memory is never freed and cannot be ...
Definition duckdb.hpp:40062
DBConfigOptions options
Database configuration options.
Definition duckdb.hpp:40090

◆ ResetGlobal()

void duckdb::BlockAllocatorMemorySetting::ResetGlobal ( DatabaseInstance * db,
DBConfig & config )
static
301632 {
301633 const auto size = DBConfigOptions().block_allocator_size;
301634 if (db) {
301635 BlockAllocator::Get(*db).Resize(size);
301636 }
301638}

◆ GetSetting()

Value duckdb::BlockAllocatorMemorySetting::GetSetting ( const ClientContext & context)
static
301640 {
301641 auto &config = DBConfig::GetConfig(context);
301642 return StringUtil::BytesToHumanReadableString(config.options.block_allocator_size);
301643}
static DUCKDB_API string BytesToHumanReadableString(idx_t bytes, idx_t multiplier=1024)
Return a string that formats the give number of bytes.
Definition duckdb.cpp:109517

Member Data Documentation

◆ Description

const char* duckdb::BlockAllocatorMemorySetting::Description
staticconstexpr
Initial value:
= "Physical memory that the block allocator is allowed to use (this "
"memory is never freed and cannot be reduced)."

The documentation for this struct was generated from the following file: