refactor sizealignoffset (#12077)
* small refactoring * refactor computeObjectOffsetFoldFunction with AccumObject * refactor packed object offstes fold function * refactor compute union object offsets fold function * merge normal/packed object offset fold function * compiletime offsetof in c++ inheritance objects * enable c++ inheritance offsetof tests * correct alignment for big sets/enums on weird 32bit platforms * uncomputedSize -> unknownSize * workaround for travis * fixes win32 alignment problems
This commit is contained in:
parent
42d2e68bca
commit
21fc8b4d4d
6 changed files with 198 additions and 230 deletions
|
|
@ -719,3 +719,13 @@ proc `$`*(c: IdeCmd): string =
|
|||
of ideOutline: "outline"
|
||||
of ideKnown: "known"
|
||||
of ideMsg: "msg"
|
||||
|
||||
proc floatInt64Align*(conf: ConfigRef): int16 =
|
||||
## Returns either 4 or 8 depending on reasons.
|
||||
if conf.target.targetCPU == cpuI386:
|
||||
#on Linux/BSD i386, double are aligned to 4bytes (except with -malign-double)
|
||||
if conf.target.targetOS != osWindows:
|
||||
# on i386 for all known POSIX systems, 64bits ints are aligned
|
||||
# to 4bytes (except with -malign-double)
|
||||
return 4
|
||||
return 8
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue