summaryrefslogtreecommitdiff
path: root/src/gcinfo
diff options
context:
space:
mode:
authorSwaroop Sridhar <Swaroop.Sridhar@microsoft.com>2016-12-06 17:17:21 -0800
committerGitHub <noreply@github.com>2016-12-06 17:17:21 -0800
commit12c3a063686c0c4f718a45c42480c4db04abeba7 (patch)
tree889f553c6cc4df8441fcdf9722fcce1ba1cc6a21 /src/gcinfo
parent41a92a370ef131be63ecb55105945ced0546fd83 (diff)
downloadcoreclr-12c3a063686c0c4f718a45c42480c4db04abeba7.tar.gz
coreclr-12c3a063686c0c4f718a45c42480c4db04abeba7.tar.bz2
coreclr-12c3a063686c0c4f718a45c42480c4db04abeba7.zip
GcInfoEncoder: Initialize the BitArrays tracking liveness (#8485)
The non-X86 GcInfoEncoder library uses two bit-arrays to keep track of pointer-liveness. The BitArrays are allocated using the arena allocator which doesn't zero-initialize them. This was causing non-deterministic redundant allocation of unused slots. This change fixes the problem.
Diffstat (limited to 'src/gcinfo')
-rw-r--r--src/gcinfo/gcinfoencoder.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gcinfo/gcinfoencoder.cpp b/src/gcinfo/gcinfoencoder.cpp
index c576d6fbbb..15d6ed9ff9 100644
--- a/src/gcinfo/gcinfoencoder.cpp
+++ b/src/gcinfo/gcinfoencoder.cpp
@@ -1163,7 +1163,8 @@ void GcInfoEncoder::Build()
int size_tCount = (m_NumSlots + BITS_PER_SIZE_T - 1) / BITS_PER_SIZE_T;
BitArray liveState(m_pAllocator, size_tCount);
BitArray couldBeLive(m_pAllocator, size_tCount);
-
+ liveState.ClearAll();
+ couldBeLive.ClearAll();
#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED
_ASSERTE(m_NumCallSites == 0 || m_pCallSites != NULL);