[Bf-blender-cvs] [9d6acc34a15] master: Fix useless allocation of edge_vectors in threaded case of loop split generation.
Bastien Montagne
noreply at git.blender.org
Fri Mar 10 15:43:45 CET 2017
Commit: 9d6acc34a15232f8316c62a53acd20595b1e0ddd
Author: Bastien Montagne
Date: Tue Mar 7 14:19:14 2017 +0100
Branches: master
https://developer.blender.org/rB9d6acc34a15232f8316c62a53acd20595b1e0ddd
Fix useless allocation of edge_vectors in threaded case of loop split generation.
===================================================================
M source/blender/blenkernel/intern/mesh_evaluate.c
===================================================================
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c
index 003b7b784d5..e96a434194c 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -991,7 +991,6 @@ static void loop_split_worker(TaskPool * __restrict UNUSED(pool), void *taskdata
#endif
}
-/* Note we use data_buff to detect whether we are in threaded context or not, in later case it is NULL. */
static void loop_split_generator_do(LoopSplitTaskDataCommon *common_data, const bool threaded)
{
MLoopNorSpaceArray *lnors_spacearr = common_data->lnors_spacearr;
@@ -1010,7 +1009,7 @@ static void loop_split_generator_do(LoopSplitTaskDataCommon *common_data, const
int data_idx = 0;
/* Temp edge vectors stack, only used when computing lnor spacearr (and we are not multi-threading). */
- BLI_Stack *edge_vectors = (lnors_spacearr && !data_buff) ? BLI_stack_new(sizeof(float[3]), __func__) : NULL;
+ BLI_Stack *edge_vectors = NULL;
#ifdef DEBUG_TIME
TIMEIT_START(loop_split_generator);
@@ -1019,6 +1018,10 @@ static void loop_split_generator_do(LoopSplitTaskDataCommon *common_data, const
if (!threaded) {
memset(&data_mem, 0, sizeof(data_mem));
data = &data_mem;
+
+ if (lnors_spacearr) {
+ edge_vectors = BLI_stack_new(sizeof(float[3]), __func__);
+ }
}
/* We now know edges that can be smoothed (with their vector, and their two loops), and edges that will be hard!
More information about the Bf-blender-cvs
mailing list