Replace compGetMemArray uses
authorMike Danes <onemihaid@hotmail.com>
Sat, 30 Jun 2018 19:45:01 +0000 (22:45 +0300)
committerMike Danes <onemihaid@hotmail.com>
Sat, 30 Jun 2018 19:45:01 +0000 (22:45 +0300)
Commit migrated from https://github.com/dotnet/coreclr/commit/10729e1a8a65bf3669049bca234187cbaf1a2e70

src/coreclr/src/jit/lclvars.cpp
src/coreclr/src/jit/optimizer.cpp
src/coreclr/src/jit/scopeinfo.cpp

index 7add5dc..a6c6330 100644 (file)
@@ -3512,7 +3512,7 @@ void Compiler::lvaSortByRefCount()
 
     if (lvaTrackedToVarNum == nullptr)
     {
-        lvaTrackedToVarNum = static_cast<unsigned*>(compGetMemArray(lclMAX_TRACKED, sizeof(unsigned), CMK_LvaTable));
+        lvaTrackedToVarNum = new (getAllocator(CMK_LvaTable)) unsigned[lclMAX_TRACKED];
     }
 
 #ifdef DEBUG
index 27120b9..6b7c3b1 100644 (file)
@@ -1146,7 +1146,7 @@ bool Compiler::optRecordLoop(BasicBlock*   head,
     if (optLoopTable == nullptr)
     {
         assert(loopInd == 0);
-        optLoopTable = static_cast<LoopDsc*>(compGetMemArray(MAX_LOOP_NUM, sizeof(LoopDsc), CMK_LoopOpt));
+        optLoopTable = getAllocator(CMK_LoopOpt).allocate<LoopDsc>(MAX_LOOP_NUM);
     }
     else
     {
index 41c3435..66f52a2 100644 (file)
@@ -393,13 +393,7 @@ void CodeGen::siInit()
         }
         else
         {
-            siLatestTrackedScopes =
-                static_cast<siScope**>(compiler->compGetMemArray(scopeCount, sizeof(siScope*), CMK_SiScope));
-
-            for (unsigned i = 0; i < scopeCount; i++)
-            {
-                siLatestTrackedScopes[i] = nullptr;
-            }
+            siLatestTrackedScopes = new (compiler->getAllocator(CMK_SiScope)) siScope* [scopeCount] {};
         }
 
         compiler->compResetScopeLists();