diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2022-07-18 15:44:29 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-18 15:44:29 -0400 |
| commit | 2e4b5770fa7e6dbf56845382706b33a22d6a025b (patch) | |
| tree | e58bcb7c446fcbffc8e1dd725636dbd737d946fc /source/core/slang-shared-library.h | |
| parent | da8f050f9865635e5778589e1e3883b614d73266 (diff) | |
Atomic ref counting for ISlangSharedLibrary (#2332)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Make ISlangSharedLibrary atomic ref counted.
Update docs to say most COM interfaces are *not* atomic ref counted.
* Upgrade slang-llvm to use version that atomic ref counts ISlangSharedLibrary.
* Fix some typos in docs.
* Fix ref count typo.
* Fix missing 'override'
Diffstat (limited to 'source/core/slang-shared-library.h')
| -rw-r--r-- | source/core/slang-shared-library.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/core/slang-shared-library.h b/source/core/slang-shared-library.h index 452379d68..44adb1ac6 100644 --- a/source/core/slang-shared-library.h +++ b/source/core/slang-shared-library.h @@ -5,6 +5,7 @@ #include "../../slang-com-helper.h" #include "../../slang-com-ptr.h" +#include "../core/slang-com-object.h" #include "../core/slang-io.h" #include "../core/slang-platform.h" #include "../core/slang-common.h" @@ -45,16 +46,16 @@ private: static DefaultSharedLibraryLoader s_singleton; }; -class DefaultSharedLibrary : public ISlangSharedLibrary, public RefObject +class DefaultSharedLibrary : public ISlangSharedLibrary, public ComBaseObject { public: SLANG_CLASS_GUID(0xe7f2597b, 0xf803, 0x4b6e, { 0xaf, 0x8b, 0xcb, 0xe3, 0xa2, 0x21, 0xfd, 0x5a }) // ISlangUnknown - virtual SLANG_NO_THROW SlangResult SLANG_MCALL queryInterface(SlangUUID const& uuid, void** outObject) SLANG_OVERRIDE; - SLANG_REF_OBJECT_IUNKNOWN_ADD_REF - SLANG_REF_OBJECT_IUNKNOWN_RELEASE - + SLANG_NO_THROW SlangResult SLANG_MCALL queryInterface(SlangUUID const& uuid, void** outObject) SLANG_OVERRIDE; + SLANG_COM_BASE_IUNKNOWN_ADD_REF + SLANG_COM_BASE_IUNKNOWN_RELEASE + // ISlangSharedLibrary virtual SLANG_NO_THROW void* SLANG_MCALL findSymbolAddressByName(char const* name) SLANG_OVERRIDE; @@ -69,7 +70,6 @@ class DefaultSharedLibrary : public ISlangSharedLibrary, public RefObject virtual ~DefaultSharedLibrary(); protected: - ISlangUnknown* getInterface(const Guid& guid); SharedLibrary::Handle m_sharedLibraryHandle = nullptr; }; |
