Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-05-09 15:54:24 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-05-09 15:54:24 +0300
commit9ac35be63a96c52c4773b4b2898b144cfa4b3438 (patch)
treeeff963b7c21614dc280cc02445b9e2bfcdcee99a /source/blender/blenlib/intern/task.c
parent86a57b04bfa6730298dc8fafe0545f6929ee64a6 (diff)
Task scheduler: Don't calloc in performance-critical areas
Majority of the fields are being overwritten anyway, so calloc it kinda waste of CPU ticks.
Diffstat (limited to 'source/blender/blenlib/intern/task.c')
-rw-r--r--source/blender/blenlib/intern/task.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/task.c b/source/blender/blenlib/intern/task.c
index e7938b750da..b657120244b 100644
--- a/source/blender/blenlib/intern/task.c
+++ b/source/blender/blenlib/intern/task.c
@@ -344,7 +344,7 @@ static void task_scheduler_clear(TaskScheduler *scheduler, TaskPool *pool)
static TaskPool *task_pool_create_ex(TaskScheduler *scheduler, void *userdata, const bool is_background)
{
- TaskPool *pool = MEM_callocN(sizeof(TaskPool), "TaskPool");
+ TaskPool *pool = MEM_mallocN(sizeof(TaskPool), "TaskPool");
#ifndef NDEBUG
/* Assert we do not try to create a background pool from some parent task - those only work OK from main thread. */
@@ -360,6 +360,7 @@ static TaskPool *task_pool_create_ex(TaskScheduler *scheduler, void *userdata, c
pool->scheduler = scheduler;
pool->num = 0;
+ pool->done = 0;
pool->num_threads = 0;
pool->currently_running_tasks = 0;
pool->do_cancel = false;
@@ -425,7 +426,7 @@ void BLI_task_pool_push_ex(
TaskPool *pool, TaskRunFunction run, void *taskdata,
bool free_taskdata, TaskFreeFunction freedata, TaskPriority priority)
{
- Task *task = MEM_callocN(sizeof(Task), "Task");
+ Task *task = MEM_mallocN(sizeof(Task), "Task");
task->run = run;
task->taskdata = taskdata;