[Bf-blender-cvs] [499c0229f7e] blender-v2.83-release: Fix T76858: non-thread safe sculpt memory allocation when using --debug-memory

Brecht Van Lommel noreply at git.blender.org
Wed May 20 00:38:56 CEST 2020


Commit: 499c0229f7e5a3bee0c2292fc58f3c7bbaf23240
Author: Brecht Van Lommel
Date:   Wed May 20 00:31:21 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB499c0229f7e5a3bee0c2292fc58f3c7bbaf23240

Fix T76858: non-thread safe sculpt memory allocation when using --debug-memory

By default the guarded memory allocator is not thread safe, that needs to be
initialized.

===================================================================

M	source/blender/blenkernel/intern/pbvh_parallel.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/pbvh_parallel.cc b/source/blender/blenkernel/intern/pbvh_parallel.cc
index adacbd13b61..aced73ec817 100644
--- a/source/blender/blenkernel/intern/pbvh_parallel.cc
+++ b/source/blender/blenkernel/intern/pbvh_parallel.cc
@@ -121,6 +121,8 @@ void BKE_pbvh_parallel_range(const int start,
 #ifdef WITH_TBB
   /* Multithreading. */
   if (settings->use_threading) {
+    BLI_threaded_malloc_begin();
+
     PBVHTask task(func, userdata, settings);
 
     if (settings->func_reduce) {
@@ -133,6 +135,7 @@ void BKE_pbvh_parallel_range(const int start,
       parallel_for(tbb::blocked_range<int>(start, stop), task);
     }
 
+    BLI_threaded_malloc_end();
     return;
   }
 #endif



More information about the Bf-blender-cvs mailing list