Mesa (master): util: convert slab macros to inline functions

Brian Paul brianp at kemper.freedesktop.org
Fri Mar 13 14:03:01 UTC 2015


Module: Mesa
Branch: master
Commit: 558dcd877095a27ce5de8198744f2f95ddf66b2a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=558dcd877095a27ce5de8198744f2f95ddf66b2a

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Mar 12 15:50:20 2015 -0600

util: convert slab macros to inline functions

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>

---

 src/gallium/auxiliary/util/u_slab.h |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_slab.h b/src/gallium/auxiliary/util/u_slab.h
index 29d0252..0df039b 100644
--- a/src/gallium/auxiliary/util/u_slab.h
+++ b/src/gallium/auxiliary/util/u_slab.h
@@ -81,7 +81,16 @@ void util_slab_destroy(struct util_slab_mempool *pool);
 void util_slab_set_thread_safety(struct util_slab_mempool *pool,
                                  enum util_slab_threading threading);
 
-#define util_slab_alloc(pool)     (pool)->alloc(pool)
-#define util_slab_free(pool, ptr) (pool)->free(pool, ptr)
+static inline void *
+util_slab_alloc(struct util_slab_mempool *pool)
+{
+   return pool->alloc(pool);
+}
+
+static inline void
+util_slab_free(struct util_slab_mempool *pool, void *ptr)
+{
+   pool->free(pool, ptr);
+}
 
 #endif




More information about the mesa-commit mailing list