MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / to_char_ptr_array

Function to_char_ptr_array

tools/server/server-models.cpp:478–486  ·  view source on GitHub ↗

helper to convert vector to char pointers are only valid as long as the original vector is valid

Source from the content-addressed store, hash-verified

476// helper to convert vector<string> to char **
477// pointers are only valid as long as the original vector is valid
478static std::vector<char *> to_char_ptr_array(const std::vector<std::string> & vec) {
479 std::vector<char *> result;
480 result.reserve(vec.size() + 1);
481 for (const auto & s : vec) {
482 result.push_back(const_cast<char*>(s.c_str()));
483 }
484 result.push_back(nullptr);
485 return result;
486}
487
488std::vector<server_model_meta> server_models::get_all_meta() {
489 std::lock_guard<std::mutex> lk(mutex);

Callers 1

loadMethod · 0.85

Calls 2

sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected