* fix #12726 Cannot take the compile-time sizeof Atomic types * fix for arch 32
This commit is contained in:
parent
a81434a890
commit
826e62953f
2 changed files with 26 additions and 7 deletions
18
tests/stdlib/concurrency/tatomics_size.nim
Normal file
18
tests/stdlib/concurrency/tatomics_size.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
discard """
|
||||
targets: "c cpp"
|
||||
"""
|
||||
import std/atomics
|
||||
|
||||
block testSize: # issue 12726
|
||||
type
|
||||
Node = ptr object
|
||||
# works
|
||||
next: Atomic[pointer]
|
||||
f:AtomicFlag
|
||||
MyChannel = object
|
||||
# type not defined completely
|
||||
back: Atomic[ptr int]
|
||||
f: AtomicFlag
|
||||
static:
|
||||
doAssert sizeof(Node) == sizeof(pointer)
|
||||
doAssert sizeof(MyChannel) == sizeof(pointer) * 2
|
||||
Loading…
Add table
Add a link
Reference in a new issue