summaryrefslogtreecommitdiff
path: root/src/jit/utils.cpp
diff options
context:
space:
mode:
authorPeter Kukol <pkukol@users.noreply.github.com>2016-09-21 22:39:06 -0700
committerGitHub <noreply@github.com>2016-09-21 22:39:06 -0700
commit0c3727eaaad0f255e18959f835de0dca3ce714eb (patch)
tree5698533aeaa06798f642b63562c1c217ed4b6d3b /src/jit/utils.cpp
parentd599d610d493d42a4e0ca0d248b9e2ae5fbf3694 (diff)
downloadcoreclr-0c3727eaaad0f255e18959f835de0dca3ce714eb.tar.gz
coreclr-0c3727eaaad0f255e18959f835de0dca3ce714eb.tar.bz2
coreclr-0c3727eaaad0f255e18959f835de0dca3ce714eb.zip
Display histogram of total memory per method when MEASURE_MEM_ALLOC is on. (#7286)
* Display histogram of total memory per method when MEASURE_MEM_ALLOC is on.
Diffstat (limited to 'src/jit/utils.cpp')
-rw-r--r--src/jit/utils.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/jit/utils.cpp b/src/jit/utils.cpp
index 9934416412..a5d4bfcb8d 100644
--- a/src/jit/utils.cpp
+++ b/src/jit/utils.cpp
@@ -876,7 +876,7 @@ void ConfigMethodRange::InitRanges(const wchar_t* rangeStr, unsigned capacity)
#endif // defined(DEBUG) || defined(INLINE_DATA)
-#if CALL_ARG_STATS || COUNT_BASIC_BLOCKS || COUNT_LOOPS || EMITTER_STATS || MEASURE_NODE_SIZE
+#if CALL_ARG_STATS || COUNT_BASIC_BLOCKS || COUNT_LOOPS || EMITTER_STATS || MEASURE_NODE_SIZE || MEASURE_MEM_ALLOC
/*****************************************************************************
* Histogram class.
@@ -896,7 +896,8 @@ Histogram::Histogram(IAllocator* allocator, const unsigned* const sizeTable)
Histogram::~Histogram()
{
- m_allocator->Free(m_counts);
+ if (m_counts != nullptr)
+ m_allocator->Free(m_counts);
}
// We need to lazy allocate the histogram data so static `Histogram` variables don't try to