diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-16 23:26:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-16 23:26:11 +0400 |
commit | 93581ab8159a0422403de67c35aa9ce8a11e8122 (patch) | |
tree | 50a5aa97e89e3198603af7f0c4825335be19d03e /source | |
parent | 508c7f3ebd4174cdba39b63984fe68e6d69bdda2 (diff) |
remove NULL check for the pool, trunk doesnt have this, caller better check.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/BLI_mempool.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c index 3dbbec057b2..4e37ac05214 100644 --- a/source/blender/blenlib/intern/BLI_mempool.c +++ b/source/blender/blenlib/intern/BLI_mempool.c @@ -111,7 +111,7 @@ BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk, mpchunk->data = use_sysmalloc ? malloc(pool->csize) : MEM_mallocN(pool->csize, "BLI Mempool Chunk Data"); BLI_addtail(&(pool->chunks), mpchunk); - if(i==0) { + if (i==0) { pool->free = mpchunk->data; /*start of the list*/ if (pool->allow_iter) pool->free->freeword = FREEWORD; @@ -129,7 +129,7 @@ BLI_mempool *BLI_mempool_create(int esize, int tote, int pchunk, } } /*final pointer in the previously allocated chunk is wrong.*/ - if(lasttail) { + if (lasttail) { lasttail->next = mpchunk->data; if (pool->allow_iter) lasttail->freeword = FREEWORD; @@ -149,8 +149,6 @@ void *BLI_mempool_alloc(BLI_mempool *pool) { void *retval=NULL; - if (!pool) return NULL; - pool->totused++; if (!(pool->free)) { @@ -245,7 +243,7 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr) void BLI_mempool_iternew(BLI_mempool *pool, BLI_mempool_iter *iter) { if (!pool->allow_iter) { - fprintf(stderr, "evil! you can't iterate over this mempool!\n"); + fprintf(stderr, "%s: Error! you can't iterate over this mempool!\n", __func__); iter->curchunk = NULL; iter->curindex = 0; |