From 2e4b5770fa7e6dbf56845382706b33a22d6a025b Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 18 Jul 2022 15:44:29 -0400 Subject: 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' --- source/core/slang-shared-library.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/core/slang-shared-library.h') 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; }; -- cgit v1.2.3