diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-05-20 01:31:21 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-05-20 01:33:49 +0300 |
commit | 499c0229f7e5a3bee0c2292fc58f3c7bbaf23240 (patch) | |
tree | 870b5ba8cc7e1de19f631a40639a50f9e6f52260 | |
parent | 59cfb20fa112e636a6ae85cb6fdc048f16af5637 (diff) |
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.
-rw-r--r-- | source/blender/blenkernel/intern/pbvh_parallel.cc | 3 |
1 files changed, 3 insertions, 0 deletions
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 |