mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-11 09:25:35 +08:00
Free the thread-local node-type cache to satisfy LeakSanitizer
cbm_kind_in_set builds a thread-local cache of calloc'd symbol bitsets (ks_cache) that was never freed, so LeakSanitizer (Linux x64) reported the per-worker-thread caches as leaks once the previously-empty grammars gained real node-type sets. Add cbm_kind_in_set_free_cache() and call it at worker-thread teardown (extract_worker, beside cbm_slab_destroy_thread) and main-thread exit (test runner, beside sqlite3_shutdown).
This commit is contained in:
@@ -48,6 +48,7 @@ enum { PP_CSHARP_M_PREFIX_LEN = 2 };
|
||||
#include "pipeline/pipeline_internal.h"
|
||||
#include "pipeline/pass_lsp_cross.h" /* cbm_pxc_* helpers for fused cross-file LSP */
|
||||
#include "pipeline/lsp_resolve.h"
|
||||
#include "helpers.h" /* cbm_kind_in_set_free_cache — per-worker-thread cache teardown */
|
||||
#include "pipeline/worker_pool.h"
|
||||
#include "foundation/compat.h"
|
||||
#include "foundation/compat_thread.h"
|
||||
@@ -635,6 +636,7 @@ static void extract_worker(int worker_id, void *ctx_ptr) {
|
||||
|
||||
/* Final cleanup (parser already destroyed in loop, just slab state) */
|
||||
cbm_slab_destroy_thread();
|
||||
cbm_kind_in_set_free_cache(); /* free this worker thread's node-type bitset cache */
|
||||
}
|
||||
|
||||
static void merge_pkg_entries(cbm_pipeline_ctx_t *ctx, cbm_pkg_entries_t *pkg_entries,
|
||||
|
||||
Reference in New Issue
Block a user