Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyredondo committed Nov 22, 2024
1 parent 876fa79 commit 49c9328
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 36 deletions.
34 changes: 0 additions & 34 deletions tracer/src/Datadog.Tracer.Native/clr_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -671,40 +671,6 @@ HRESULT IsTypeByRefLike(ICorProfilerInfo4* corProfilerInfo4, const ModuleMetadat

HRESULT IsTypeTokenByRefLike(ICorProfilerInfo4* corProfilerInfo4, const ModuleMetadataBase& module_metadata, mdToken typeDefOrRefOrSpecToken,
bool& isTypeIsByRefLike);

template<class MetaInterface>
class COMPtrHolder {
public:
COMPtrHolder() {
m_ptr = NULL;
}

COMPtrHolder(MetaInterface *ptr) {
m_ptr = ptr;
}

~COMPtrHolder() {
if (m_ptr != NULL) {
m_ptr->Release();
m_ptr = NULL;
}
}

MetaInterface *operator->() {
return m_ptr;
}

MetaInterface **operator&() {
return &m_ptr;
}

operator MetaInterface *() {
return m_ptr;
}

private:
MetaInterface *m_ptr;
};
} // namespace trace

#endif // DD_CLR_PROFILER_CLR_HELPERS_H_
4 changes: 2 additions & 2 deletions tracer/src/Datadog.Tracer.Native/rejit_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ bool RejitHandlerModuleMethod::RequestRejitForInlinersInModule(ModuleID moduleId
{
// Now we enumerate all methods that inline the current methodDef
BOOL incompleteData = false;
COMPtrHolder<ICorProfilerMethodEnum> methodEnum = NULL;
ComPtr<ICorProfilerMethodEnum> methodEnum;

HRESULT hr = pInfo->EnumNgenModuleMethodsInliningThisMethod(moduleId, currentModuleId, currentMethodDef,
&incompleteData, &methodEnum);
&incompleteData, methodEnum.GetAddressOf());
std::ostringstream hexValue;
hexValue << std::hex << hr;
if (SUCCEEDED(hr))
Expand Down

0 comments on commit 49c9328

Please sign in to comment.