diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-12-10 14:17:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-12-10 14:28:52 +0400 |
commit | 737e51cb21cc3864dca3da7e754549e08660f193 (patch) | |
tree | 531d4180781753bc9ffd0800cd2dc1c4340a6a3e /source/blender | |
parent | 02e378bf19d349031fb7397ccf7e26885289f34d (diff) |
Mempool/Memarena: hint for unlikely conditions
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenlib/intern/BLI_memarena.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_mempool.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/BLI_memarena.c b/source/blender/blenlib/intern/BLI_memarena.c index ce04ac61ef4..dd0997c8e1c 100644 --- a/source/blender/blenlib/intern/BLI_memarena.c +++ b/source/blender/blenlib/intern/BLI_memarena.c @@ -117,7 +117,7 @@ void *BLI_memarena_alloc(MemArena *ma, size_t size) * size up to multiple of 8 */ size = PADUP(size, ma->align); - if (size > ma->cursize) { + if (UNLIKELY(size > ma->cursize)) { if (size > ma->bufsize - (ma->align - 1)) { ma->cursize = PADUP(size + 1, ma->align); } diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c index c2b54023621..1321f006e36 100644 --- a/source/blender/blenlib/intern/BLI_mempool.c +++ b/source/blender/blenlib/intern/BLI_mempool.c @@ -295,7 +295,7 @@ void *BLI_mempool_alloc(BLI_mempool *pool) pool->totused++; - if (!(pool->free)) { + if (UNLIKELY(pool->free == NULL)) { /* need to allocate a new chunk */ BLI_mempool_chunk *mpchunk = mempool_chunk_alloc(pool); mempool_chunk_add(pool, mpchunk, NULL); |