From 183ba284f213903f2208349fe1dd57c07c327ad9 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 20 May 2020 00:59:41 +0200 Subject: Cleanup: make guarded memory allocation always thread safe Previously this would be enabled when threads were used, but threads are now basically always in use so there is no point. Further, this is only needed for guarded allocation with --debug-memory which is not performance critical. --- source/blender/blenlib/intern/task_pool.cc | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'source/blender/blenlib/intern/task_pool.cc') diff --git a/source/blender/blenlib/intern/task_pool.cc b/source/blender/blenlib/intern/task_pool.cc index 670787697a3..cf328ec407c 100644 --- a/source/blender/blenlib/intern/task_pool.cc +++ b/source/blender/blenlib/intern/task_pool.cc @@ -364,14 +364,6 @@ static void background_task_pool_free(TaskPool *pool) static TaskPool *task_pool_create_ex(void *userdata, TaskPoolType type, TaskPriority priority) { - /* Ensure malloc will go fine from threads, - * - * This is needed because we could be in main thread here - * and malloc could be non-thread safe at this point because - * no other jobs are running. - */ - BLI_threaded_malloc_begin(); - const bool use_threads = BLI_task_scheduler_num_threads() > 1 && type != TASK_POOL_NO_THREADS; /* Background task pool uses regular TBB scheduling if available. Only when @@ -475,8 +467,6 @@ void BLI_task_pool_free(TaskPool *pool) BLI_mutex_end(&pool->user_mutex); MEM_freeN(pool); - - BLI_threaded_malloc_end(); } void BLI_task_pool_push(TaskPool *pool, -- cgit v1.2.3