From a6e54e794434959220fa5ee749ee3e8b4dea6534 Mon Sep 17 00:00:00 2001 From: cnkz Date: Wed, 10 Jan 2024 12:01:24 +0100 Subject: [PATCH] Closing in on ubuntu crash reason. --- src/ManagedObjectSize.Tests/ObjectSizeTests.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ManagedObjectSize.Tests/ObjectSizeTests.cs b/src/ManagedObjectSize.Tests/ObjectSizeTests.cs index 0d718b3..36c7815 100644 --- a/src/ManagedObjectSize.Tests/ObjectSizeTests.cs +++ b/src/ManagedObjectSize.Tests/ObjectSizeTests.cs @@ -375,13 +375,12 @@ public unsafe void ObjectSize_ReportsCorrectSize(bool useRtHelpers, bool useObje GetSize(options, name, obj, data); - GC.EndNoGCRegion(); -#if false using (var dt = DataTarget.CreateSnapshotAndAttach(Environment.ProcessId)) { // Got the snapshot. Release GC. GC.EndNoGCRegion(); +#if false using (var runtime = dt.ClrVersions.Single().CreateRuntime()) { Assert.IsTrue(runtime.Heap.CanWalkHeap); @@ -417,8 +416,8 @@ public unsafe void ObjectSize_ReportsCorrectSize(bool useRtHelpers, bool useObje } } } - } #endif + } } // We could also use [DynamicData] to conduct the test of different objects/types, which would