Tune C7 v4 partial reuse for mixed perf

This commit is contained in:
Moe Charm (CI)
2025-12-10 18:03:28 +09:00
parent cbd33511eb
commit 860d934d71

View File

@ -17,7 +17,7 @@
// TLS context
static __thread small_heap_ctx_v4 g_ctx_v4;
#define V4_MAX_PARTIAL_PAGES 2
#define V4_MAX_PARTIAL_PAGES 1
small_heap_ctx_v4* small_heap_ctx_v4_get(void) {
return &g_ctx_v4;
@ -175,8 +175,12 @@ static small_page_v4* small_alloc_slow_v4(small_heap_ctx_v4* ctx, int class_idx)
return cur; // usable current
}
if (cur && !cur->freelist) {
// current を full list に残しておき、free で戻す
v4_page_push_full(h, cur);
// current をいったん partial/full に退避partial を優先)
if (h->partial_count < V4_MAX_PARTIAL_PAGES) {
v4_page_push_partial(h, cur);
} else {
v4_page_push_full(h, cur);
}
h->current = NULL;
}