[Mesa-dev] [RFC 21/21] mesa/extensions: Declare _mesa_init_extensions() static inline

Nanley Chery nanleychery at gmail.com
Mon Oct 19 15:44:59 PDT 2015


From: Nanley Chery <nanley.g.chery at intel.com>

Avoid the function call overhead for this one-liner.

Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
---
 src/mesa/main/extensions.c | 14 --------------
 src/mesa/main/extensions.h | 16 ++++++++++++++--
 2 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index d050b0f..1f6caac 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -360,20 +360,6 @@ _mesa_one_time_init_extension_overrides(void)
 }
 
 
-/**
- * \brief Initialize extension tables and enable default extensions.
- *
- * This should be called during context initialization.
- * This function expects a zeroed gl_extensions struct.
- * Note: Sets gl_extensions.dummy_true to true.
- */
-void
-_mesa_init_extensions(struct gl_extensions *extensions)
-{
-   extensions->dummy_true = GL_TRUE;
-}
-
-
 typedef unsigned short extension_index;
 
 
diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h
index 8f106aa..3953894 100644
--- a/src/mesa/main/extensions.h
+++ b/src/mesa/main/extensions.h
@@ -45,8 +45,6 @@ extern void _mesa_enable_sw_extensions(struct gl_context *ctx);
 
 extern void _mesa_one_time_init_extension_overrides(void);
 
-extern void _mesa_init_extensions(struct gl_extensions *extentions);
-
 extern GLubyte *_mesa_make_extension_string(struct gl_context *ctx);
 
 extern GLuint
@@ -57,6 +55,20 @@ _mesa_get_enabled_extension(struct gl_context *ctx, GLuint index);
 
 
 /**
+ * \brief Initialize extension tables and enable default extensions.
+ *
+ * This should be called during context initialization.
+ * This function expects a zeroed gl_extensions struct.
+ * Note: Sets gl_extensions.dummy_true to true.
+ */
+static inline void
+_mesa_init_extensions(struct gl_extensions *extensions)
+{
+   extensions->dummy_true = GL_TRUE;
+}
+
+
+/**
  * \brief An element of the \c extension_table.
  */
 struct extension {
-- 
2.6.1



More information about the mesa-dev mailing list