From 156687ac8b91a77fdcf4418d0a157ebe10056c1c Mon Sep 17 00:00:00 2001 From: Daan Date: Mon, 10 Feb 2025 20:26:19 -0800 Subject: [PATCH] rename to mi_thread_set_in_threadpool --- include/mimalloc.h | 4 ++-- src/heap.c | 4 ---- src/init.c | 3 +++ 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/mimalloc.h b/include/mimalloc.h index 0dd269de..dbb6e7bf 100644 --- a/include/mimalloc.h +++ b/include/mimalloc.h @@ -307,8 +307,8 @@ mi_decl_export bool mi_abandoned_visit_blocks(mi_subproc_id_t subproc_id, int he mi_decl_export void mi_heap_guarded_set_sample_rate(mi_heap_t* heap, size_t sample_rate, size_t seed); mi_decl_export void mi_heap_guarded_set_size_bound(mi_heap_t* heap, size_t min, size_t max); -// Experimental: communicate that the thread associated with the heap runs in a threadpool -mi_decl_export void mi_heap_set_in_threadpool(void) mi_attr_noexcept; +// Experimental: communicate that the thread is part of a threadpool +mi_decl_export void mi_thread_set_in_threadpool(void) mi_attr_noexcept; // Experimental: create a new heap with a specified heap tag. Set `allow_destroy` to false to allow the thread // to reclaim abandoned memory (with a compatible heap_tag and arena_id) but in that case `mi_heap_destroy` will diff --git a/src/heap.c b/src/heap.c index 64e3b257..f856a426 100644 --- a/src/heap.c +++ b/src/heap.c @@ -205,10 +205,6 @@ mi_heap_t* mi_heap_get_backing(void) { return bheap; } -void mi_heap_set_in_threadpool(void) mi_attr_noexcept { - // nothing -} - void _mi_heap_init(mi_heap_t* heap, mi_tld_t* tld, mi_arena_id_t arena_id, bool noreclaim, uint8_t tag) { _mi_memcpy_aligned(heap, &_mi_heap_empty, sizeof(mi_heap_t)); heap->tld = tld; diff --git a/src/init.c b/src/init.c index 734bf5de..7cef8eea 100644 --- a/src/init.c +++ b/src/init.c @@ -547,6 +547,9 @@ void _mi_heap_set_default_direct(mi_heap_t* heap) { _mi_prim_thread_associate_default_heap(heap); } +void mi_thread_set_in_threadpool(void) mi_attr_noexcept { + // nothing +} // -------------------------------------------------------- // Run functions on process init/done, and thread init/done