[x86/Linux] Use 4-byte align for double in struct (dotnet/coreclr#10340)
authorJonghyun Park <parjong@gmail.com>
Tue, 21 Mar 2017 04:36:27 +0000 (13:36 +0900)
committerJan Kotas <jkotas@microsoft.com>
Tue, 21 Mar 2017 04:36:27 +0000 (21:36 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/be9896c8c27f1ef6ac6df46031bb69d56195712e

src/coreclr/src/vm/fieldmarshaler.h

index 9ec7e87..287da41 100644 (file)
@@ -85,7 +85,12 @@ enum NStructFieldType
 //=======================================================================
 // Magic number for default struct packing size.
 //=======================================================================
+#if defined(_TARGET_X86_) && defined(UNIX_X86_ABI)
+// A double is 4-byte aligned on GCC (without -malign-dobule)
+#define DEFAULT_PACKING_SIZE 4
+#else // _TARGET_X86_ && UNIX_X86_ABI
 #define DEFAULT_PACKING_SIZE 8
+#endif // !_TARGET_X86_ || !UNIX_X86_ABI
 
 
 //=======================================================================