CVS: winex/loader module.c,1.28,1.29

[email protected] 31 Jul 2007 18:01:20 -0000
Newsgroups gmane.comp.emulators.winex.cvs
Message-ID <[email protected]>
Subject: winex/loader module.c,1.28,1.29Update of /var/lib/cvsd/cvsroot/winex/loader
In directory agravaine:/tmp/cvs-serv25011/loader

Modified Files:
	module.c 
Log Message:

- check for already-loaded modules prior to checking the filesystem



Index: module.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/loader/module.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- module.c	28 Mar 2007 21:03:16 -0000	1.28
+++ module.c	31 Jul 2007 18:01:18 -0000	1.29
@@ -1494,6 +1494,14 @@
 
         take_loader_lock();
 
+        /* Optimization - first check for already-loaded module to avoid
+           all the filesystem checking */
+        if ((pwm = MODULE_FindModule (libname)))
+        {
+           strcpy (filename, libname);
+           goto got_module;
+        }
+
         if ((flags & LOAD_WITH_ALTERED_SEARCH_PATH) && FILE_contains_path(libname))
         {
             if (!(libdir = allocate_lib_dir(libname))) goto error;
@@ -1553,6 +1561,7 @@
 		HeapFree( GetProcessHeap(), 0, fn );
 	    }
 	}
+ got_module:
 	if (pwm)
 	{
 		if(!(pwm->flags & WINE_MODREF_MARKER))