Optimize Critical Section Functions

Michael Stefaniuc mstefani at redhat.com
Fri Aug 20 14:30:23 CDT 2004


Andreas Mohr wrote:
> Hi,
> 
> On Fri, Aug 20, 2004 at 04:50:36PM +0100, Robert Shearman wrote:
> 
>>Index: wine/dlls/ntdll/critsection.c
>>===================================================================
>>RCS file: /home/wine/wine/dlls/ntdll/critsection.c,v
>>retrieving revision 1.26
>>diff -u -p -r1.26 critsection.c
>>--- wine/dlls/ntdll/critsection.c	17 Jun 2004 23:11:08 -0000	1.26
>>+++ wine/dlls/ntdll/critsection.c	20 Aug 2004 15:46:18 -0000
>>@@ -36,6 +36,14 @@
>> WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
>> WINE_DECLARE_DEBUG_CHANNEL(relay);
>> 
>>+#ifdef __GNUC__
>>+# define likely(x)   __builtin_expect(!!(x), 1)
>>+# define unlikely(x) __builtin_expect(!!(x), 0)
>>+#else
>>+# define likely(x)   !!(x)
>>+# define unlikely(x) !!(x)
>>+#endif
>>+
> 
> 
> Umm, this should go into a global header file, right?
> The theory being that it would be useful at many more performance critical
> Wine places...
> 
> But I have to admit that I don't know which header file this should be...
Like in the Linux kernel (where this seems to come from) in compiler.h 
or something like that.

bye
	michael


-- 
Michael Stefaniuc               Tel.: +49-711-96437-199
System Administration           Fax.: +49-711-96437-111
Red Hat GmbH                    Email: mstefani at redhat.com
Hauptstaetterstr. 58            http://www.redhat.de/
D-70178 Stuttgart




More information about the wine-devel mailing list