// The most call site records have only `methodHandle`, so creating two separate maps give us better perfomance
// and smaller memory consumption. Note: we are not reading values from these maps during a normal replay.
RecordCallSiteWithSignature = new LightWeightMap<DWORD, Agnostic_RecordCallSite>();
- RecordCallSiteWithoutSignature = new LightWeightMap<DWORD, DWORDLONG>();
+ if (recordCallSitesWithoutSig)
+ {
+ RecordCallSiteWithoutSignature = new LightWeightMap<DWORD, DWORDLONG>();
+ }
}
if (callSig != nullptr)
value.methodHandle = CastHandle(methodHandle);
RecordCallSiteWithSignature->Add(instrOffset, value);
}
- else
+ else if (recordCallSitesWithoutSig)
{
RecordCallSiteWithoutSignature->Add(instrOffset, CastHandle(methodHandle));
}
MemoryTracker* memoryTracker;
Capture_AllocMemDetails allocMemDets;
allocGCInfoDetails allocGCInfoDets;
+
+ const bool recordCallSitesWithoutSig = false; // Set it to true if you want to use CallUtils::GetRecordedCallSiteInfo.
};
#endif
if (numItems > 0)
{
- for (unsigned int i = numItems; i > insert; i--)
- {
- pKeys[i] = pKeys[i - 1];
- pItems[i] = pItems[i - 1];
- }
+ int countToMove = (numItems - insert);
+ memmove(&pKeys[insert+1], &pKeys[insert], countToMove * sizeof(pKeys[insert]));
+ memmove(&pItems[insert+1], &pItems[insert], countToMove * sizeof(pItems[insert]));
}
pKeys[insert] = key;