Skip to content

Commit eed6a84

Browse files
VSadovdavmason
authored andcommitted
Removed support for short plug padding in fit.
Best fit is only done for gen1->gen2, and thus there is no padding.
1 parent 97e3083 commit eed6a84

File tree

1 file changed

+5
-37
lines changed

1 file changed

+5
-37
lines changed

src/gc/gc.cpp

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8809,10 +8809,6 @@ class seg_free_spaces
88098809
#endif //_DEBUG
88108810

88118811
uint8_t* fit (uint8_t* old_loc,
8812-
#ifdef SHORT_PLUGS
8813-
BOOL set_padding_on_saved_p,
8814-
mark* pinned_plug_entry,
8815-
#endif //SHORT_PLUGS
88168812
size_t plug_size
88178813
REQD_ALIGN_AND_OFFSET_DCL)
88188814
{
@@ -8836,12 +8832,8 @@ class seg_free_spaces
88368832
size_t plug_size_to_fit = plug_size;
88378833

88388834
// best fit is only done for gen1 to gen2 and we do not pad in gen2.
8839-
int pad_in_front = 0;
8840-
8841-
#ifdef SHORT_PLUGS
8842-
plug_size_to_fit += (pad_in_front ? Align(min_obj_size) : 0);
8843-
#endif //SHORT_PLUGS
8844-
8835+
// however we must account for requirements of large alignment.
8836+
// which may result in realignment padding.
88458837
#ifdef RESPECT_LARGE_ALIGNMENT
88468838
plug_size_to_fit += switch_alignment_size(FALSE);
88478839
#endif //RESPECT_LARGE_ALIGNMENT
@@ -8884,29 +8876,17 @@ class seg_free_spaces
88848876
{
88858877
size_t free_space_size = 0;
88868878
pad = 0;
8887-
#ifdef SHORT_PLUGS
8888-
BOOL short_plugs_padding_p = FALSE;
8889-
#endif //SHORT_PLUGS
8879+
88908880
BOOL realign_padding_p = FALSE;
88918881

88928882
if (bucket_free_space[i].is_plug)
88938883
{
88948884
mark* m = (mark*)(bucket_free_space[i].start);
88958885
uint8_t* plug_free_space_start = pinned_plug (m) - pinned_len (m);
8896-
8897-
#ifdef SHORT_PLUGS
8898-
if ((pad_in_front & USE_PADDING_FRONT) &&
8899-
(((plug_free_space_start - pin_allocation_context_start_region (m))==0) ||
8900-
((plug_free_space_start - pin_allocation_context_start_region (m))>=DESIRED_PLUG_LENGTH)))
8901-
{
8902-
pad = Align (min_obj_size);
8903-
short_plugs_padding_p = TRUE;
8904-
}
8905-
#endif //SHORT_PLUGS
89068886

8907-
if (!((old_loc == 0) || same_large_alignment_p (old_loc, plug_free_space_start+pad)))
8887+
if (!((old_loc == 0) || same_large_alignment_p (old_loc, plug_free_space_start)))
89088888
{
8909-
pad += switch_alignment_size (pad != 0);
8889+
pad += switch_alignment_size (FALSE);
89108890
realign_padding_p = TRUE;
89118891
}
89128892

@@ -8933,14 +8913,6 @@ class seg_free_spaces
89338913
index_of_highest_set_bit (new_free_space_size)));
89348914
#endif //SIMPLE_DPRINTF
89358915

8936-
#ifdef SHORT_PLUGS
8937-
if (short_plugs_padding_p)
8938-
{
8939-
pin_allocation_context_start_region (m) = plug_free_space_start;
8940-
set_padding_in_expand (old_loc, set_padding_on_saved_p, pinned_plug_entry);
8941-
}
8942-
#endif //SHORT_PLUGS
8943-
89448916
if (realign_padding_p)
89458917
{
89468918
set_node_realigned (old_loc);
@@ -14140,10 +14112,6 @@ uint8_t* gc_heap::allocate_in_expanded_heap (generation* gen,
1414014112
dprintf (SEG_REUSE_LOG_1, ("reallocating 0x%Ix in expanded heap, size: %Id",
1414114113
old_loc, size));
1414214114
return bestfit_seg->fit (old_loc,
14143-
#ifdef SHORT_PLUGS
14144-
set_padding_on_saved_p,
14145-
pinned_plug_entry,
14146-
#endif //SHORT_PLUGS
1414714115
size REQD_ALIGN_AND_OFFSET_ARG);
1414814116
}
1414914117

0 commit comments

Comments
 (0)