Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make GCMemoryInfoData blittable #58738

Merged
merged 4 commits into from
Sep 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions src/coreclr/vm/comutilnative.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,7 @@ struct GCGenerationInfo
UINT64 fragmentationAfter;
};

#if defined(TARGET_X86) && !defined(TARGET_UNIX)
#include "pshpack4.h"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4121) // alignment of a member was sensitive to packing
#endif
#endif
class GCMemoryInfoData : public Object
{
public:
Expand All @@ -107,6 +101,7 @@ class GCMemoryInfoData : public Object
UINT32 pauseTimePercent;
UINT8 isCompaction;
UINT8 isConcurrent;
UINT8 padding[6];
GCGenerationInfo generationInfo0;
GCGenerationInfo generationInfo1;
GCGenerationInfo generationInfo2;
Expand All @@ -115,12 +110,7 @@ class GCMemoryInfoData : public Object
UINT64 pauseDuration0;
UINT64 pauseDuration1;
};
#if defined(TARGET_X86) && !defined(TARGET_UNIX)
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#include "poppack.h"
#endif

#ifdef USE_CHECKED_OBJECTREFS
typedef REF<GCMemoryInfoData> GCMEMORYINFODATA;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ internal sealed class GCMemoryInfoData
internal long _index;
internal int _generation;
internal int _pauseTimePercentage;
internal bool _compacted;
internal bool _concurrent;
internal byte _compacted;
internal byte _concurrent;

private GCGenerationInfo _generationInfo0;
private GCGenerationInfo _generationInfo1;
Expand Down Expand Up @@ -158,12 +158,12 @@ internal GCMemoryInfo(GCMemoryInfoData data)
/// <summary>
/// Is this a compacting GC or not.
/// </summary>
public bool Compacted => _data._compacted;
public bool Compacted => _data._compacted != 0;

/// <summary>
/// Is this a concurrent GC (BGC) or not.
/// </summary>
public bool Concurrent => _data._concurrent;
public bool Concurrent => _data._concurrent != 0;

/// <summary>
/// Total committed bytes of the managed heap.
Expand Down