diff --git a/core/smallobject_hotbox_v4.c b/core/smallobject_hotbox_v4.c index 6f3ddd21..a2cf1c30 100644 --- a/core/smallobject_hotbox_v4.c +++ b/core/smallobject_hotbox_v4.c @@ -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; }