summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2015-12-02 10:07:38 -0800
committerJan Kotas <jkotas@microsoft.com>2015-12-02 10:07:38 -0800
commit487d85ca531524341fb4c5d189794677572411b1 (patch)
treedb55fdad1e40decb93ab5f710fd87185cf915a37 /src
parent002e393586e0a5fa43612851cf42b7253f7ffbb8 (diff)
parent1ace764f6de4ce4ccea8caeb60a88503c08cb0e6 (diff)
downloadcoreclr-487d85ca531524341fb4c5d189794677572411b1.tar.gz
coreclr-487d85ca531524341fb4c5d189794677572411b1.tar.bz2
coreclr-487d85ca531524341fb4c5d189794677572411b1.zip
Merge pull request #2203 from dotnet-bot/from-tfs
Merge changes from TFS
Diffstat (limited to 'src')
-rw-r--r--src/gc/gc.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp
index 761437f9cc..86e4583dfd 100644
--- a/src/gc/gc.cpp
+++ b/src/gc/gc.cpp
@@ -75,6 +75,9 @@ inline BOOL ShouldTrackMovementForProfilerOrEtw()
int compact_ratio = 0;
#endif //GC_CONFIG_DRIVEN
+// See comments in reset_memory.
+BOOL reset_mm_p = TRUE;
+
#if defined (TRACE_GC) && !defined (DACCESS_COMPILE)
const char * const allocation_state_str[] = {
"start",
@@ -29975,11 +29978,6 @@ void gc_heap::decommit_ephemeral_segment_pages()
#endif //_WIN64
slack_space = min (slack_space, new_slack_space);
-
- size_t saved_slack_space = slack_space;
- new_slack_space = ((slack_space < gen0_big_free_spaces) ? 0 : (slack_space - gen0_big_free_spaces));
- slack_space = new_slack_space;
- dprintf (1, ("ss: %Id->%Id", saved_slack_space, slack_space));
}
decommit_heap_segment_pages (ephemeral_heap_segment, slack_space);
@@ -30545,8 +30543,15 @@ void reset_memory (uint8_t* o, size_t sizeo)
size_t page_start = align_on_page ((size_t)(o + size_to_skip));
size_t size = align_lower_page ((size_t)o + sizeo - size_to_skip - plug_skew) - page_start;
- VirtualAlloc ((char*)page_start, size, MEM_RESET, PAGE_READWRITE);
- VirtualUnlock ((char*)page_start, size);
+ // Note we need to compensate for an OS bug here. This bug would cause the MEM_RESET to fail
+ // on write watched memory.
+ if (reset_mm_p)
+ {
+ if (VirtualAlloc ((char*)page_start, size, MEM_RESET, PAGE_READWRITE))
+ VirtualUnlock ((char*)page_start, size);
+ else
+ reset_mm_p = FALSE;
+ }
}
#endif //!FEATURE_PAL
}