diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-07 23:07:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-07 23:24:05 +0400 |
commit | b3afbcab8ff2330c1473647be330a3ffe9b11885 (patch) | |
tree | e86b9c7d9676e63b8da92da79889dee13b8be186 /source/blender/blenlib/intern/BLI_mempool.c | |
parent | 1c24d954f4ac63f22b703756b6664a4ad1b363d4 (diff) |
ListBase API: add utility api funcs for clearing and checking empty
Diffstat (limited to 'source/blender/blenlib/intern/BLI_mempool.c')
-rw-r--r-- | source/blender/blenlib/intern/BLI_mempool.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c index 1321f006e36..7dc43bb1494 100644 --- a/source/blender/blenlib/intern/BLI_mempool.c +++ b/source/blender/blenlib/intern/BLI_mempool.c @@ -233,7 +233,7 @@ static void mempool_chunk_free_all(ListBase *chunks, const unsigned int flag) mpchunk_next = mpchunk->next; mempool_chunk_free(mpchunk, flag); } - chunks->first = chunks->last = NULL; + BLI_listbase_clear(chunks); } BLI_mempool *BLI_mempool_create(unsigned int esize, unsigned int totelem, @@ -268,7 +268,7 @@ BLI_mempool *BLI_mempool_create(unsigned int esize, unsigned int totelem, pool->flag = flag; pool->pchunk = pchunk; pool->csize = esize * pchunk; - pool->chunks.first = pool->chunks.last = NULL; + BLI_listbase_clear(&pool->chunks); pool->free = NULL; /* mempool_chunk_add assigns */ pool->maxchunks = maxchunks; #ifdef USE_TOTALLOC @@ -598,7 +598,7 @@ void BLI_mempool_clear_ex(BLI_mempool *pool, const int totelem_reserve) #endif chunks_temp = pool->chunks; - pool->chunks.first = pool->chunks.last = NULL; + BLI_listbase_clear(&pool->chunks); while ((mpchunk = BLI_pophead(&chunks_temp))) { lasttail = mempool_chunk_add(pool, mpchunk, lasttail); |