[Mesa-dev] [PATCH 3.1/7] util/slab: Rename slab_mempool typed parameters to mempool

Ian Romanick idr at freedesktop.org
Mon Nov 26 19:18:10 UTC 2018


From: Ian Romanick <ian.d.romanick at intel.com>

Now everything with type 'struct slab_child_pool *' is name pool, and
everything with type 'struct slab_mempool *' is named mempool.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
 src/util/slab.c | 20 ++++++++++----------
 src/util/slab.h |  8 ++++----
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/util/slab.c b/src/util/slab.c
index 5f048666b56..5477c75d443 100644
--- a/src/util/slab.c
+++ b/src/util/slab.c
@@ -280,25 +280,25 @@ void slab_free(struct slab_child_pool *pool, void *ptr)
  * Allocate an object from the slab. Single-threaded (no mutex).
  */
 void *
-slab_alloc_st(struct slab_mempool *pool)
+slab_alloc_st(struct slab_mempool *mempool)
 {
-   return slab_alloc(&pool->child);
+   return slab_alloc(&mempool->child);
 }
 
 /**
  * Free an object allocated from the slab. Single-threaded (no mutex).
  */
 void
-slab_free_st(struct slab_mempool *pool, void *ptr)
+slab_free_st(struct slab_mempool *mempool, void *ptr)
 {
-   slab_free(&pool->child, ptr);
+   slab_free(&mempool->child, ptr);
 }
 
 void
-slab_destroy(struct slab_mempool *pool)
+slab_destroy(struct slab_mempool *mempool)
 {
-   slab_destroy_child(&pool->child);
-   slab_destroy_parent(&pool->parent);
+   slab_destroy_child(&mempool->child);
+   slab_destroy_parent(&mempool->parent);
 }
 
 /**
@@ -308,10 +308,10 @@ slab_destroy(struct slab_mempool *pool)
  * \param num_items     Number of objects to allocate at once.
  */
 void
-slab_create(struct slab_mempool *pool,
+slab_create(struct slab_mempool *mempool,
             unsigned item_size,
             unsigned num_items)
 {
-   slab_create_parent(&pool->parent, item_size, num_items);
-   slab_create_child(&pool->child, &pool->parent);
+   slab_create_parent(&mempool->parent, item_size, num_items);
+   slab_create_child(&mempool->child, &mempool->parent);
 }
diff --git a/src/util/slab.h b/src/util/slab.h
index e83f8ec1a0e..5a25adaf7f4 100644
--- a/src/util/slab.h
+++ b/src/util/slab.h
@@ -84,11 +84,11 @@ struct slab_mempool {
    struct slab_child_pool child;
 };
 
-void slab_create(struct slab_mempool *pool,
+void slab_create(struct slab_mempool *mempool,
                  unsigned item_size,
                  unsigned num_items);
-void slab_destroy(struct slab_mempool *pool);
-void *slab_alloc_st(struct slab_mempool *pool);
-void slab_free_st(struct slab_mempool *pool, void *ptr);
+void slab_destroy(struct slab_mempool *mempool);
+void *slab_alloc_st(struct slab_mempool *mempool);
+void slab_free_st(struct slab_mempool *mempool, void *ptr);
 
 #endif
-- 
2.14.5



More information about the mesa-dev mailing list