提交 4ae63739 编写于 作者: R Rene Damm

Don't bump alignment for small structures on x64 to stay compatible with ABI.

上级 6f0e6a28
......@@ -1782,6 +1782,9 @@ mono_class_layout_fields (MonoClass *class)
break;
}
#if !defined(__x86_64__) /* Disable for x86_64 to stay compatible with default ABI layouting rules. We keep
natural alignment for structs which is enough to not generate alignment errors on
things like pointers and such. */
if (layout != TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) {
/*
* For small structs, set min_align to at least the struct size to improve
......@@ -1791,6 +1794,7 @@ mono_class_layout_fields (MonoClass *class)
if (class->instance_size <= sizeof (MonoObject) + sizeof (gpointer))
class->min_align = MAX (class->min_align, class->instance_size - sizeof (MonoObject));
}
#endif
class->size_inited = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册