diff --git a/src/mem/threadalloc.h b/src/mem/threadalloc.h index 306c782..0fd0dc4 100644 --- a/src/mem/threadalloc.h +++ b/src/mem/threadalloc.h @@ -254,14 +254,6 @@ namespace snmalloc }; # ifdef SNMALLOC_USE_THREAD_CLEANUP - /** - * Entry point that allows libc to call into the allocator for per-thread - * cleanup. - */ - extern "C" void _malloc_thread_cleanup() - { - ThreadAllocLibcCleanup::inner_release(); - } using ThreadAlloc = ThreadAllocLibcCleanup; # else using ThreadAlloc = ThreadAllocThreadDestructor; @@ -306,3 +298,13 @@ namespace snmalloc } #endif } // namespace snmalloc +#ifdef SNMALLOC_USE_THREAD_CLEANUP +/** + * Entry point that allows libc to call into the allocator for per-thread + * cleanup. + */ +void _malloc_thread_cleanup() +{ + snmalloc::ThreadAllocLibcCleanup::inner_release(); +} +#endif