Skip to content

Commit 57e04c6

Browse files
committed
fix(pipeline): preserve allocation policy in resolver cleanup
Use tracked zeroed storage for the parallel LSP failure array and release it with the matching memory class after worker joins. Share import-filter failure cleanup without changing fallback state. Keep existing raw-allocation allowances unchanged. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 132ded8 commit 57e04c6

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎src/pipeline/pass_lsp_cross.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,8 +2361,7 @@ CBMLSPDef *cbm_pxc_filter_defs_for_file(const CBMModuleDefIndex *idx, CBMLSPDef
23612361
pxc_mark_module_defs(idx, selected, all_defs, caller_lang, own_module, &total);
23622362
for (int i = 0; i < imp_count; i++) {
23632363
if (!pxc_mark_import_defs(idx, selected, all_defs, caller_lang, imp_qns[i], &total)) {
2364-
free(selected);
2365-
return NULL; /* out_success remains false: dispatcher uses all_defs */
2364+
goto failed; /* out_success remains false: dispatcher uses all_defs */
23662365
}
23672366
}
23682367
if (pxc_is_jvm_lang(caller_lang) && idx->namespace_ht) {
@@ -2379,8 +2378,7 @@ CBMLSPDef *cbm_pxc_filter_defs_for_file(const CBMModuleDefIndex *idx, CBMLSPDef
23792378

23802379
CBMLSPDef *out = (CBMLSPDef *)malloc((size_t)total * sizeof(CBMLSPDef));
23812380
if (!out) {
2382-
cbm_free(CBM_MEM_CLASS_EXTRACT, selected);
2383-
return NULL;
2381+
goto failed;
23842382
}
23852383

23862384
int n = 0;
@@ -2393,4 +2391,7 @@ CBMLSPDef *cbm_pxc_filter_defs_for_file(const CBMModuleDefIndex *idx, CBMLSPDef
23932391
*out_success = true;
23942392
cbm_free(CBM_MEM_CLASS_EXTRACT, selected);
23952393
return out;
2394+
failed:
2395+
cbm_free(CBM_MEM_CLASS_EXTRACT, selected);
2396+
return NULL;
23962397
}

0 commit comments

Comments
 (0)