-
- Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
The align pragma is not applied if one of the field is generic, test case:
import atomics type Bug[T] = object bug{.align:64.}: T sideffect{.align:64.}: int type Foo[T] = object foo{.align:64.}: int sideffect{.align:64.}: int type Bar = object bar{.align:64.}: int sideffect{.align:64.}: int type Baz = object baz{.align:64.}: Atomic[int] sideffect{.align:64.}: int var bug: Bug[int] var x: Foo[int] var y: Bar var z: Baz doAssert sizeof(x) == 128 doAssert sizeof(y) == 128 doAssert sizeof(z) == 128 doAssert sizeof(bug) == 128, "Oops my size is " & $sizeof(bug) # 16It is missing in the C codegen.