[Bf-blender-cvs] [9dab894e64] unlock_task_scheduler: Inline all task-pushing helpers.
Bastien Montagne
noreply at git.blender.org
Fri Mar 3 17:49:11 CET 2017
Commit: 9dab894e641d5190a26c6fafb918d9503cc76f3b
Author: Bastien Montagne
Date: Fri Dec 23 12:33:27 2016 +0100
Branches: unlock_task_scheduler
https://developer.blender.org/rB9dab894e641d5190a26c6fafb918d9503cc76f3b
Inline all task-pushing helpers.
Those are small enough to be worth it, and it does give me ~2% speedup here...
===================================================================
M source/blender/blenlib/intern/task.c
===================================================================
diff --git a/source/blender/blenlib/intern/task.c b/source/blender/blenlib/intern/task.c
index 560ad7f88e..e53327640f 100644
--- a/source/blender/blenlib/intern/task.c
+++ b/source/blender/blenlib/intern/task.c
@@ -235,7 +235,7 @@ static void task_free(TaskPool *pool, Task *task, const int thread_id)
/* Task Scheduler */
-static void task_pool_num_decrease(TaskPool *pool, size_t done)
+BLI_INLINE void task_pool_num_decrease(TaskPool *pool, size_t done)
{
BLI_assert(pool->num >= done);
TaskScheduler *scheduler = pool->scheduler;
@@ -255,7 +255,7 @@ static void task_pool_num_decrease(TaskPool *pool, size_t done)
}
}
-static void task_pool_num_increase(TaskPool *pool)
+BLI_INLINE void task_pool_num_increase(TaskPool *pool)
{
atomic_add_and_fetch_z(&pool->num, 1);
@@ -346,7 +346,7 @@ BLI_INLINE bool task_wait(TaskScheduler * restrict scheduler, int * restrict loo
return false;
}
-static bool task_scheduler_thread_wait_pop(TaskScheduler *scheduler, Task **task)
+BLI_INLINE bool task_scheduler_thread_wait_pop(TaskScheduler *scheduler, Task **task)
{
bool found_task = false;
int loop_count = 0;
@@ -514,7 +514,7 @@ int BLI_task_scheduler_num_threads(TaskScheduler *scheduler)
return scheduler->num_threads + 1;
}
-static void task_scheduler_push(TaskScheduler *scheduler, Task *task, TaskPriority priority)
+BLI_INLINE void task_scheduler_push(TaskScheduler *scheduler, Task *task, TaskPriority priority)
{
TaskPool *pool = task->pool;
More information about the Bf-blender-cvs
mailing list