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

2015-10-20 Thread Nanley Chery
On Tue, Oct 20, 2015 at 8:57 AM, Marek Olšák  wrote:

> On Tue, Oct 20, 2015 at 12:44 AM, Nanley Chery 
> wrote:
> > From: Nanley Chery 
> >
> > Avoid the function call overhead for this one-liner.
>
> Can you measure the overhead? If not, there is no reason for this change.
>
>
The .text size does decrease by 48 bytes:
 text   data bss   dec hex filename
5190616  209856   27712 5428184  52d3d8 lib/i965_dri.so (before)
5190568  209856   27712 5428136  52d3a8 lib/i965_dri.so (after)

Is this sufficient? If so, I can add the snippet above to the git comment.

Regards,
Nanley

Marek
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2015-10-20 Thread Nanley Chery
On Tue, Oct 20, 2015 at 9:31 AM, Marek Olšák  wrote:

> On Tue, Oct 20, 2015 at 6:25 PM, Nanley Chery 
> wrote:
> >
> >
> > On Tue, Oct 20, 2015 at 8:57 AM, Marek Olšák  wrote:
> >>
> >> On Tue, Oct 20, 2015 at 12:44 AM, Nanley Chery 
> >> wrote:
> >> > From: Nanley Chery 
> >> >
> >> > Avoid the function call overhead for this one-liner.
> >>
> >> Can you measure the overhead? If not, there is no reason for this
> change.
> >>
> >
> > The .text size does decrease by 48 bytes:
> >  text   data bss   dec hex filename
> > 5190616  209856   27712 5428184  52d3d8 lib/i965_dri.so (before)
> > 5190568  209856   27712 5428136  52d3a8 lib/i965_dri.so (after)
> >
> > Is this sufficient? If so, I can add the snippet above to the git
> comment.
>
> I don't think so. :)
>
>
:) Okay. I suppose that the function isn't called often enough to warrant
the loss of encapsulation.

Thanks,
Nanley


> Marek
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2015-10-20 Thread Marek Olšák
On Tue, Oct 20, 2015 at 12:44 AM, Nanley Chery  wrote:
> From: Nanley Chery 
>
> Avoid the function call overhead for this one-liner.

Can you measure the overhead? If not, there is no reason for this change.

Marek
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2015-10-20 Thread Marek Olšák
On Tue, Oct 20, 2015 at 6:25 PM, Nanley Chery  wrote:
>
>
> On Tue, Oct 20, 2015 at 8:57 AM, Marek Olšák  wrote:
>>
>> On Tue, Oct 20, 2015 at 12:44 AM, Nanley Chery 
>> wrote:
>> > From: Nanley Chery 
>> >
>> > Avoid the function call overhead for this one-liner.
>>
>> Can you measure the overhead? If not, there is no reason for this change.
>>
>
> The .text size does decrease by 48 bytes:
>  text   data bss   dec hex filename
> 5190616  209856   27712 5428184  52d3d8 lib/i965_dri.so (before)
> 5190568  209856   27712 5428136  52d3a8 lib/i965_dri.so (after)
>
> Is this sufficient? If so, I can add the snippet above to the git comment.

I don't think so. :)

Marek
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2015-10-19 Thread Nanley Chery
From: Nanley Chery 

Avoid the function call overhead for this one-liner.

Signed-off-by: Nanley Chery 
---
 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

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev