stability and memory access fixes (codex generated/reviewed)

This commit is contained in:
Concedo
2026-09-13 22:27:35 +08:00
parent 49b9132287
commit 874f833a54
3 changed files with 53 additions and 32 deletions
+3 -2
View File
@@ -412,8 +412,9 @@ extern "C"
return detokenized_str.c_str();
}
static std::vector<TopPicksData> last_logprob_toppicks;
static std::vector<logprob_item> last_logprob_items;
// Returned pointers remain valid until the next call on the same thread.
static thread_local std::vector<TopPicksData> last_logprob_toppicks;
static thread_local std::vector<logprob_item> last_logprob_items;
last_logprobs_outputs last_logprobs()
{
last_logprobs_outputs output;