From: Ivan Chikish Date: Mon, 16 Feb 2026 15:52:24 +0000 (+0300) Subject: common : inline functions (#18639) X-Git-Tag: gguf-v0.18.0~99 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=cceb1b4e33cfd9595b4ac1949f2c0857e43af427;p=pkg%2Fggml%2Fsources%2Fllama.cpp common : inline functions (#18639) --- diff --git a/common/common.h b/common/common.h index 804485fb1..641024837 100644 --- a/common/common.h +++ b/common/common.h @@ -670,7 +670,7 @@ static std::vector string_split(const std::string & str, char delim) { } template<> -std::vector string_split(const std::string & input, char separator) +inline std::vector string_split(const std::string & input, char separator) { std::vector parts; size_t begin_pos = 0; @@ -685,7 +685,7 @@ std::vector string_split(const std::string & input, ch return parts; } -static bool string_starts_with(const std::string & str, +inline bool string_starts_with(const std::string & str, const std::string & prefix) { // While we wait for C++20's std::string::starts_with... return str.rfind(prefix, 0) == 0; } @@ -870,11 +870,11 @@ const char * const LLM_KV_SPLIT_TENSORS_COUNT = "split.tensors.count"; const char * const LLM_FFN_EXPS_REGEX = "\\.ffn_(up|down|gate)_(ch|)exps"; -static std::string llm_ffn_exps_block_regex(int idx) { +inline std::string llm_ffn_exps_block_regex(int idx) { return string_format("blk\\.%d%s", idx, LLM_FFN_EXPS_REGEX); } -static llama_model_tensor_buft_override llm_ffn_exps_cpu_override() { +inline llama_model_tensor_buft_override llm_ffn_exps_cpu_override() { return { LLM_FFN_EXPS_REGEX, ggml_backend_cpu_buffer_type() }; }