llvm-6502/lib/Support/Windows
David Majnemer 00f31bac0b Windows: Use GetModuleHandleEx instead of LoadLibrary
We were using an anti-pattern of:
 - LoadLibrary
 - GetProcAddress
 - FreeLibrary

This is problematic because of several reasons:
 - We are holding on to pointers into a library we just unloaded.
 - Calling LoadLibrary results in an increase in the reference count of
   the library in question and any libraries that it depends on and
   so-on and so-forth.  This is none too quick.

Instead, use GetModuleHandleEx with GET_MODULE_HANDLE_EX_FLAG_PIN.  This
is done because because we didn't bring the reference for the library
into existence and therefor shouldn't count on it being around later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192550 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-13 10:34:21 +00:00
..
DynamicLibrary.inc Revert "Revert "Windows: Add support for unicode command lines"" 2013-10-07 01:00:07 +00:00
explicit_symbols.inc Windows/DynamicLibrary.inc: Fix trivial warnings. Thanks to John Myers! 2011-07-09 08:41:20 +00:00
Host.inc revert r147542 after comments from Joerg Sonnenberger 2012-01-05 18:28:46 +00:00
Memory.inc Add a comment about the requirement that the Windows.h header be last. 2012-12-04 07:04:57 +00:00
Mutex.inc
Path.inc Windows: Be more explicit with Win32 APIs 2013-10-07 09:52:36 +00:00
Process.inc Windows: Avoiding resizing, use uninitialized data() instead 2013-10-07 21:57:07 +00:00
Program.inc Windows: Be more explicit with Win32 APIs 2013-10-07 09:52:36 +00:00
RWMutex.inc Windows: Use GetModuleHandleEx instead of LoadLibrary 2013-10-13 10:34:21 +00:00
Signals.inc Windows: Be more explicit with Win32 APIs 2013-10-07 09:52:36 +00:00
system_error.inc Make Win32's header file name lower for cross build on case-sensitive filesystem. 2011-02-04 12:53:04 +00:00
ThreadLocal.inc Satisfy C++ aliasing rules, per suggestion by Chandler. 2012-06-12 01:06:16 +00:00
TimeValue.inc Add missing #include's to cctype when using isdigit/alpha/etc. 2013-10-12 00:55:57 +00:00
Watchdog.inc Add a new watchdog timer interface. The interface does not permit handling timeouts, so 2013-03-26 01:27:52 +00:00
Windows.h Revert "Revert "Windows: Add support for unicode command lines"" 2013-10-07 01:00:07 +00:00