tatomics_size.nim 390 B

123456789101112131415161718
  1. discard """
  2. targets: "c cpp"
  3. """
  4. import std/atomics
  5. block testSize: # issue 12726
  6. type
  7. Node = ptr object
  8. # works
  9. next: Atomic[pointer]
  10. f:AtomicFlag
  11. MyChannel = object
  12. # type not defined completely
  13. back: Atomic[ptr int]
  14. f: AtomicFlag
  15. static:
  16. doAssert sizeof(Node) == sizeof(pointer)
  17. doAssert sizeof(MyChannel) == sizeof(pointer) * 2