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>2014-06-08 17:07:00 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-06-08 17:09:30 +0400
commitb707b07c5b9f9c952ceab5135aab77ca58eb7d49 (patch)
tree863253fe22cf4c87d476009b1dcbbaf1277b4a20
parentc6ea6e368b90b69b9e97aeb557b7bde6dce8f44c (diff)
Fix mempool bottleneck alloc & freeing a single item
Would continuously reinitialize the first chunk of the mempool, now check for at least 2 blocks.
-rw-r--r--source/blender/blenlib/intern/BLI_mempool.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c
index 448fefa5979..8fc5f97221d 100644
--- a/source/blender/blenlib/intern/BLI_mempool.c
+++ b/source/blender/blenlib/intern/BLI_mempool.c
@@ -409,7 +409,9 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr)
#endif
/* nothing is in use; free all the chunks except the first */
- if (UNLIKELY(pool->totused == 0)) {
+ if (UNLIKELY(pool->totused == 0) &&
+ (pool->chunks->next))
+ {
const unsigned int esize = pool->esize;
BLI_freenode *curnode;
unsigned int j;