Prevent wildcards from being accepted in filenames (NT mode)

Andreas Mohr andi at rhlx01.fht-esslingen.de
Thu Nov 27 03:55:13 CST 2003


Hi,

On Thu, Nov 27, 2003 at 09:01:00AM +0200, Shachar Shemesh wrote:
> Something that does affect efficiency, which I debated with myself for 
> some time, is the order of the tests. As the "if" is, by far, much more 
> likely to be false than true, we should order the condition using a cost 
> function that takes into account how much each condition costs to test, 
> and how likely it is to fail (as that's the case wer'e trying to 
> optimize - we don't really care how long it's going to take in case the 
> "if" is true).
> 
> My original gut feeling was to place the conditions in reverse order. 
> That is, first test for version, only then test whether there are any 
> wildcards in the string. The reason I submitted it as I did was that the 
> first attempt would not work. It appears that "DOSFS_GetFullName" is 
> called before the structs needed for "GetVersion" to function are 
> initialized. As such, reversing the order was necessary to make it work 
> (that, or insert complicated changes throughout the entire kernel 
> initialization).
> 
> In retrospect, this form is better. GetVersion is not a simple function, 
> and is far less likely to fail than strchr. I guess ideal would be to 
> have a global inside kernel.dll that tells us whether wer'e NT or not. 
> There is no such global at the moment, however, and I did not wish to 
> introduce one.
Hmm, given your GetVersion thoughts, do we already have a janitorial or
"Fun Project" that deals with sorting all concatenated if's to have the
smallest penalty first?

This might have some good effect on Wine speed...

Or maybe not?

Andreas Mohr

-- 
Wir kommen alle als Original zur Welt, aber die meisten von uns
sterben als Kopien (Autor unbekannt)



More information about the wine-devel mailing list