#define POTENTIALLY_UNUSED
#endif
-using namespace std;
-
AllocationData::DisplayId AllocationData::display = AllocationData::DisplayId::malloc;
bool AccumulatedTraceData::isHideUnmanagedStackParts = false;
bool AccumulatedTraceData::isShowCoreCLRPartOption = false;
+typedef unsigned int uint;
+
namespace {
template <typename Base>
}
template <typename Base>
-ostream& operator<<(ostream& out, const Index<Base> index)
+std::ostream& operator<<(std::ostream& out, const Index<Base> index)
{
out << index.index;
return out;
objectTreeNodes.reserve(16384);
}
-const string& AccumulatedTraceData::stringify(const StringIndex stringId) const
+const std::string& AccumulatedTraceData::stringify(const StringIndex stringId) const
{
if (!stringId || stringId.index > strings.size()) {
- static const string empty;
+ static const std::string empty;
return empty;
} else {
return strings.at(stringId.index - 1);
}
}
-string AccumulatedTraceData::prettyFunction(const string& function) const
+std::string AccumulatedTraceData::prettyFunction(const std::string& function) const
{
if (!shortenTemplates) {
return function;
}
- string ret;
+ std::string ret;
ret.reserve(function.size());
int depth = 0;
for (size_t i = 0; i < function.size(); ++i) {
return ret;
}
-bool AccumulatedTraceData::read(const string& inputFile)
+bool AccumulatedTraceData::read(const std::string& inputFile)
{
if (totalTime == 0) {
return read(inputFile, FirstPass) && read(inputFile, SecondPass);
}
}
-bool AccumulatedTraceData::read(const string& inputFile, const ParsePass pass)
+bool AccumulatedTraceData::read(const std::string& inputFile, const ParsePass pass)
{
+ using namespace std;
+
const bool isCompressed = boost::algorithm::ends_with(inputFile, ".gz");
ifstream file(inputFile, isCompressed ? ios_base::in | ios_base::binary : ios_base::in);
return read(in, pass);
}
-bool AccumulatedTraceData::read(istream& in, const ParsePass pass)
+bool AccumulatedTraceData::read(std::istream& in, const ParsePass pass)
{
+ using namespace std;
+
LineReader reader;
int64_t timeStamp = 0;
namespace { // helpers for diffing
template <typename IndexT, typename SortF>
-vector<IndexT> sortedIndices(size_t numIndices, SortF sorter)
+std::vector<IndexT> sortedIndices(size_t numIndices, SortF sorter)
{
+ using namespace std;
vector<IndexT> indices;
indices.resize(numIndices);
for (size_t i = 0; i < numIndices; ++i) {
return indices;
}
-vector<StringIndex> remapStrings(vector<string>& lhs, const vector<string>& rhs)
+std::vector<StringIndex> remapStrings(std::vector<std::string>& lhs, const std::vector<std::string>& rhs)
{
+ using namespace std;
+
unordered_map<string, StringIndex> stringRemapping;
StringIndex stringIndex;
{
POTENTIALLY_UNUSED void printTrace(const AccumulatedTraceData& data, TraceIndex index)
{
+ using namespace std;
do {
const auto trace = data.findTrace(index);
const auto& ip = data.findIp(trace.ipIndex);
// step 1: sort trace indices of allocations for efficient lookup
// step 2: while at it, also merge equal allocations
- vector<TraceIndex> allocationTraceNodes;
+ std::vector<TraceIndex> allocationTraceNodes;
allocationTraceNodes.reserve(allocations.size());
for (auto it = allocations.begin(); it != allocations.end();) {
const auto& allocation = *it;
auto sortedIt =
- lower_bound(allocationTraceNodes.begin(), allocationTraceNodes.end(), allocation.traceIndex,
+ std::lower_bound(allocationTraceNodes.begin(), allocationTraceNodes.end(), allocation.traceIndex,
[this](const TraceIndex& lhs, const TraceIndex& rhs) -> bool {
return compareTraceIndices(lhs, *this, rhs, *this, identity<InstructionPointer>) < 0;
});
// copy the rhs trace index and the data it references into the lhs data,
// recursively
- function<TraceIndex(TraceIndex)> copyTrace = [this, &base, remapIpIndex,
+ std::function<TraceIndex(TraceIndex)> copyTrace = [this, &base, remapIpIndex,
©Trace](TraceIndex rhsIndex) -> TraceIndex {
if (!rhsIndex) {
return rhsIndex;
}
template <typename A1>
-inline QString i18nc(const char */*comment*/, const char *text, const A1 &a1)
+inline QString i18nc(const char * /*comment*/, const char *text, const A1 &a1)
{
return QString(text).arg(a1);
}
template <typename A1, typename A2>
-inline QString i18nc(const char */*comment*/, const char *text, const A1 &a1, const A2 &a2)
+inline QString i18nc(const char * /*comment*/, const char *text, const A1 &a1, const A2 &a2)
{
return QString(text).arg(a1).arg(a2);
}
template <typename A1, typename A2, typename A3>
-inline QString i18nc(const char */*comment*/, const char *text, const A1 &a1, const A2 &a2, const A3 &a3)
+inline QString i18nc(const char * /*comment*/, const char *text, const A1 &a1, const A2 &a2, const A3 &a3)
{
return QString(text).arg(a1).arg(a2).arg(a3);
}
template <typename A1, typename A2, typename A3, typename A4>
-inline QString i18nc(const char */*comment*/, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
+inline QString i18nc(const char * /*comment*/, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4)
{
return QString(text).arg(a1).arg(a2).arg(a3).arg(a4);
}
template <typename A1, typename A2, typename A3, typename A4, typename A5>
-inline QString i18nc(const char */*comment*/, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4,
+inline QString i18nc(const char * /*comment*/, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4,
const A5 &a5)
{
return QString(text).arg(a1).arg(a2).arg(a3).arg(a4).arg(a5);
}
template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
-inline QString i18nc(const char */*comment*/, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4,
+inline QString i18nc(const char * /*comment*/, const char *text, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4,
const A5 &a5, const A6 &a6)
{
return QString(text).arg(a1).arg(a2).arg(a3).arg(a4).arg(a5).arg(a6);
}
template <typename A1>
-inline QString i18np(const char */*singular*/, const char *plural, const A1 &a1)
+inline QString i18np(const char * /*singular*/, const char *plural, const A1 &a1)
{
return QString(plural).arg(a1);
}