Skip to content

Commit

Permalink
Fix compilation errors on non-windows platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
mdh1418 committed Jul 8, 2024
1 parent 6818023 commit 5458ce5
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

#include "gcheapenumerationprofiler.h"
#include <wchar.h>
#include "../profilerstring.h"

#if WIN32
#define EXPORT
Expand Down Expand Up @@ -34,7 +34,9 @@ HRESULT GCHeapEnumerationProfiler::Initialize(IUnknown* pICorProfilerInfoUnk)
printf("FAIL: ICorProfilerInfo::GetEnvironmentVariable() failed hr=0x%x", hr);
return hr;
}
if (wcscmp(envVar, L"TRUE") == 0)
String envVarStr = envVar;
String expectedEnvVarStr = reinterpret_cast<const WCHAR*>(u"TRUE");
if (envVarStr == expectedEnvVarStr)
{
printf("Setting GarbageCollectionStarted event masks\n");
eventMask |= COR_PRF_MONITOR_GC;
Expand Down Expand Up @@ -128,7 +130,8 @@ static BOOL STDMETHODCALLTYPE heap_walk_fn(ObjectID object, void* callbackState)
}

String classIdName = state->instance->GetClassIDNameHelper(classId);
if (classIdName.ToWString() == L"CustomGCHeapObject")
String expectedCustomObjectClass = reinterpret_cast<const WCHAR*>(u"CustomGCHeapObject");
if (classIdName == expectedCustomObjectClass)
{
state->customGcHeapObjectTypeCount->fetch_add(1, std::memory_order_relaxed);
}
Expand Down

0 comments on commit 5458ce5

Please sign in to comment.