[pypy-commit] pypy win32-fixes5: force 4 byte alignment on windows
mattip
noreply at buildbot.pypy.org
Wed Sep 24 15:32:13 CEST 2014
Author: mattip <matti.picus at gmail.com>
Branch: win32-fixes5
Changeset: r73671:b878317fc5f0
Date: 2014-09-24 16:30 +0300
http://bitbucket.org/pypy/pypy/changeset/b878317fc5f0/
Log: force 4 byte alignment on windows
diff --git a/rpython/rtyper/tool/rffi_platform.py b/rpython/rtyper/tool/rffi_platform.py
--- a/rpython/rtyper/tool/rffi_platform.py
+++ b/rpython/rtyper/tool/rffi_platform.py
@@ -107,15 +107,18 @@
fields is properly aligned."""
global _memory_alignment
if _memory_alignment is None:
- S = getstruct('struct memory_alignment_test', """
- struct memory_alignment_test {
- double d;
- void* p;
- };
- """, [])
- result = S._hints['align']
- assert result & (result-1) == 0, "not a power of two??"
- _memory_alignment = result
+ if sys.platform == 'win32':
+ _memory_alignment = 4
+ else:
+ S = getstruct('struct memory_alignment_test', """
+ struct memory_alignment_test {
+ double d;
+ void* p;
+ };
+ """, [])
+ result = S._hints['align']
+ assert result & (result-1) == 0, "not a power of two??"
+ _memory_alignment = result
return _memory_alignment
_memory_alignment = None
More information about the pypy-commit
mailing list