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:
authorCampbell Barton <ideasman42@gmail.com>2021-06-10 11:16:17 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-06-10 17:31:16 +0300
commitbcefce33f24dd3646b84e1baa0db6db76222f1c2 (patch)
tree9fe354b16d815a8a2ea9fb6735333320d96768db /source/blender/blenlib/intern/BLI_mempool_private.h
parent9df1e0cad54599c53a1eb877651fceb461d88148 (diff)
BLI_mempool: split thread-safe iteration into the private API
Splitting out thread safe iteration logic means regular iteration isn't checking for the thread-safe pointer each step. This gives a small but measurable overall performance gain of 2-3% when redrawing a high-poly mesh. Ref D11564 Reviewed By: mont29
Diffstat (limited to 'source/blender/blenlib/intern/BLI_mempool_private.h')
-rw-r--r--source/blender/blenlib/intern/BLI_mempool_private.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/BLI_mempool_private.h b/source/blender/blenlib/intern/BLI_mempool_private.h
index 60994624ecd..e1c8205c80c 100644
--- a/source/blender/blenlib/intern/BLI_mempool_private.h
+++ b/source/blender/blenlib/intern/BLI_mempool_private.h
@@ -31,8 +31,13 @@
#include "BLI_mempool.h"
#include "BLI_task.h"
-typedef struct ParallelMempoolTaskData {
+typedef struct BLI_mempool_threadsafe_iter {
BLI_mempool_iter iter;
+ struct BLI_mempool_chunk **curchunk_threaded_shared;
+} BLI_mempool_threadsafe_iter;
+
+typedef struct ParallelMempoolTaskData {
+ BLI_mempool_threadsafe_iter ts_iter;
TaskParallelTLS tls;
} ParallelMempoolTaskData;
@@ -40,6 +45,8 @@ ParallelMempoolTaskData *mempool_iter_threadsafe_create(BLI_mempool *pool, const
ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
void mempool_iter_threadsafe_destroy(ParallelMempoolTaskData *iter_arr) ATTR_NONNULL();
+void *mempool_iter_threadsafe_step(BLI_mempool_threadsafe_iter *iter);
+
#ifdef __cplusplus
}
#endif