diff options
author | Pat Gavlin <pagavlin@microsoft.com> | 2016-04-15 15:35:33 -0700 |
---|---|---|
committer | Pat Gavlin <pagavlin@microsoft.com> | 2016-04-15 16:05:12 -0700 |
commit | 9e4dccced24917bb8d155331095404d1a28c7887 (patch) | |
tree | 351b52fd5f527c40432eff3bbdde4004eb2f4f0a /src/gcinfo | |
parent | 18487e02501fd13ba67e6d5dc1e2f145109eb2db (diff) | |
download | coreclr-9e4dccced24917bb8d155331095404d1a28c7887.tar.gz coreclr-9e4dccced24917bb8d155331095404d1a28c7887.tar.bz2 coreclr-9e4dccced24917bb8d155331095404d1a28c7887.zip |
Stop including utilcode.h in the GC info encoder.
This required two other minor changes:
- A prototype for `ThrowOutOfMemory` is now defined in gcinfoencoder.h
- `BitArray` now defines an overload of `operator new` that accepts an
`IAllocator`.
Diffstat (limited to 'src/gcinfo')
-rw-r--r-- | src/gcinfo/gcinfoencoder.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gcinfo/gcinfoencoder.cpp b/src/gcinfo/gcinfoencoder.cpp index b76290bd56..0f34a3bd4c 100644 --- a/src/gcinfo/gcinfoencoder.cpp +++ b/src/gcinfo/gcinfoencoder.cpp @@ -220,6 +220,11 @@ public: } #endif + static void* operator new(size_t size, IAllocator* allocator) + { + return allocator->Alloc(size); + } + private: size_t * m_pData; size_t * m_pEndData; @@ -1836,7 +1841,7 @@ void GcInfoEncoder::Build() UINT32 liveStateOffset = 0; if (!hashMap.Lookup(&liveState, &liveStateOffset)) { - BitArray * newLiveState = new (m_pAllocator->Alloc(sizeof(BitArray))) BitArray(m_pAllocator, size_tCount); + BitArray * newLiveState = new (m_pAllocator) BitArray(m_pAllocator, size_tCount); *newLiveState = liveState; hashMap.Set(newLiveState, (UINT32)(-1)); } @@ -1864,7 +1869,7 @@ void GcInfoEncoder::Build() UINT32 liveStateOffset = 0; if (!hashMap.Lookup(&liveState, &liveStateOffset)) { - BitArray * newLiveState = new (m_pAllocator->Alloc(sizeof(BitArray))) BitArray(m_pAllocator, size_tCount); + BitArray * newLiveState = new (m_pAllocator) BitArray(m_pAllocator, size_tCount); *newLiveState = liveState; hashMap.Set(newLiveState, (UINT32)(-1)); } |