diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-08-14 05:07:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-08-14 05:07:33 +0400 |
commit | f2821e392b3670a094da187d3b16f74568e4a172 (patch) | |
tree | b217750c334444c7046060b1baaa3e6169ba5434 /source/blender/blenkernel/intern/CCGSubSurf.c | |
parent | 28054d8e386dbaee80d439fdf9c7ba7eb6bfe39f (diff) |
hint checks to re-alloc as unlikely
also edit comments for knife tool
Diffstat (limited to 'source/blender/blenkernel/intern/CCGSubSurf.c')
-rw-r--r-- | source/blender/blenkernel/intern/CCGSubSurf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c index 6cda0a1bc33..623fb50b62c 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.c +++ b/source/blender/blenkernel/intern/CCGSubSurf.c @@ -119,7 +119,7 @@ static void _ehash_insert(EHash *eh, EHEntry *entry) eh->buckets[hash] = entry; eh->numEntries++; - if (eh->numEntries > (numBuckets * 3)) { + if (UNLIKELY(eh->numEntries > (numBuckets * 3))) { EHEntry **oldBuckets = eh->buckets; eh->curSize = kHashSizes[++eh->curSizeIdx]; @@ -1274,7 +1274,7 @@ CCGError ccgSubSurf_syncFace(CCGSubSurf *ss, CCGFaceHDL fHDL, int numVerts, CCGV CCGFace *f = NULL, *fNew; int j, k, topologyChanged = 0; - if (numVerts > ss->lenTempArrays) { + if (UNLIKELY(numVerts > ss->lenTempArrays)) { ss->lenTempArrays = (numVerts < ss->lenTempArrays * 2) ? ss->lenTempArrays * 2 : numVerts; ss->tempVerts = MEM_reallocN(ss->tempVerts, sizeof(*ss->tempVerts) * ss->lenTempArrays); ss->tempEdges = MEM_reallocN(ss->tempEdges, sizeof(*ss->tempEdges) * ss->lenTempArrays); |