Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Merge changes from TFS #3

Merged
merged 2 commits into from
Feb 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions src/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16132,8 +16132,18 @@ void gc_heap::enque_pinned_plug (BYTE* plug,

if (save_pre_plug_info_p)
{
#ifdef SHORT_PLUGS
BOOL is_padded = is_plug_padded (last_object_in_last_plug);
if (is_padded)
clear_plug_padded (last_object_in_last_plug);
#endif //SHORT_PLUGS
memcpy (&(m.saved_pre_plug), &(((plug_and_gap*)plug)[-1]), sizeof (gap_reloc_pair));
memcpy (&(m.saved_pre_plug_reloc), &(m.saved_pre_plug), sizeof (gap_reloc_pair));
#ifdef SHORT_PLUGS
if (is_padded)
set_plug_padded (last_object_in_last_plug);
#endif //SHORT_PLUGS

memcpy (&(m.saved_pre_plug_reloc), &(((plug_and_gap*)plug)[-1]), sizeof (gap_reloc_pair));

// If the last object in the last plug is too short, it requires special handling.
size_t last_obj_size = plug - last_object_in_last_plug;
Expand Down Expand Up @@ -16175,8 +16185,19 @@ void gc_heap::save_post_plug_info (BYTE* last_pinned_plug, BYTE* last_object_in_
mark& m = mark_stack_array[mark_stack_tos - 1];
assert (last_pinned_plug == m.first);
m.saved_post_plug_info_start = (BYTE*)&(((plug_and_gap*)post_plug)[-1]);

#ifdef SHORT_PLUGS
BOOL is_padded = is_plug_padded (last_object_in_last_plug);
if (is_padded)
clear_plug_padded (last_object_in_last_plug);
#endif //SHORT_PLUGS
memcpy (&(m.saved_post_plug), m.saved_post_plug_info_start, sizeof (gap_reloc_pair));
memcpy (&(m.saved_post_plug_reloc), &(m.saved_post_plug), sizeof (gap_reloc_pair));
#ifdef SHORT_PLUGS
if (is_padded)
set_plug_padded (last_object_in_last_plug);
#endif //SHORT_PLUGS

memcpy (&(m.saved_post_plug_reloc), m.saved_post_plug_info_start, sizeof (gap_reloc_pair));

// This is important - we need to clear all bits here except the last one.
m.saved_post_p = TRUE;
Expand Down
4 changes: 4 additions & 0 deletions tests/src/JIT/Directed/Arrays/complex1.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

using System;

// Do a complex 5 dimensional Jagged array.
Expand Down
4 changes: 4 additions & 0 deletions tests/src/JIT/Directed/Arrays/simple1.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

using System;
public
// Do a simple 5 dimensional Jagged array.
Expand Down