summaryrefslogtreecommitdiff
path: root/src/jit/alloc.cpp
diff options
context:
space:
mode:
authorDavid Wrighton <davidwr@microsoft.com>2017-09-13 14:50:39 -0700
committerDavid Wrighton <davidwr@microsoft.com>2017-09-13 14:50:39 -0700
commitd68f0916d0a2bf3787bc85261ef4a4f1f27f1f24 (patch)
tree6c21ac239ae268096f20d98a8db16a4b80394fd9 /src/jit/alloc.cpp
parent96fa98525e0d64459148228cde5211c475b0c25c (diff)
parente866d072042f4ad9e0811aa36e338dac781c09a5 (diff)
downloadcoreclr-d68f0916d0a2bf3787bc85261ef4a4f1f27f1f24.tar.gz
coreclr-d68f0916d0a2bf3787bc85261ef4a4f1f27f1f24.tar.bz2
coreclr-d68f0916d0a2bf3787bc85261ef4a4f1f27f1f24.zip
Merge branch 'master' into update_from_master
Diffstat (limited to 'src/jit/alloc.cpp')
-rw-r--r--src/jit/alloc.cpp54
1 files changed, 0 insertions, 54 deletions
diff --git a/src/jit/alloc.cpp b/src/jit/alloc.cpp
index 5c5f712a3f..4cde8664dc 100644
--- a/src/jit/alloc.cpp
+++ b/src/jit/alloc.cpp
@@ -308,60 +308,6 @@ void ArenaAllocator::freeHostMemory(void* block)
#endif // !defined(DEBUG)
}
-#if defined(DEBUG)
-//------------------------------------------------------------------------
-// ArenaAllocator::alloateMemory:
-// Allocates memory using an `ArenaAllocator`.
-//
-// Arguments:
-// size - The number of bytes to allocate.
-//
-// Return Value:
-// A pointer to the allocated memory.
-//
-// Note:
-// This is the DEBUG-only version of `allocateMemory`; the release
-// version of this method is defined in the corresponding header file.
-// This version of the method has some abilities that the release
-// version does not: it may inject faults into the allocator and
-// seeds all allocations with a specified pattern to help catch
-// use-before-init problems.
-void* ArenaAllocator::allocateMemory(size_t size)
-{
- assert(isInitialized());
- assert(size != 0 && (size & (sizeof(int) - 1)) == 0);
-
- // Ensure that we always allocate in pointer sized increments.
- size = (size_t)roundUp(size, sizeof(size_t));
-
- if (JitConfig.ShouldInjectFault() != 0)
- {
- // Force the underlying memory allocator (either the OS or the CLR hoster)
- // to allocate the memory. Any fault injection will kick in.
- void* p = ClrAllocInProcessHeap(0, S_SIZE_T(1));
- if (p != nullptr)
- {
- ClrFreeInProcessHeap(0, p);
- }
- else
- {
- NOMEM(); // Throw!
- }
- }
-
- void* block = m_nextFreeByte;
- m_nextFreeByte += size;
-
- if (m_nextFreeByte > m_lastFreeByte)
- {
- block = allocateNewPage(size, true);
- }
-
- memset(block, UninitializedWord<char>(), size);
- return block;
-}
-#endif // defined(DEBUG)
-
//------------------------------------------------------------------------
// ArenaAllocator::getTotalBytesAllocated:
// Gets the total number of bytes allocated for all of the arena pages