tatomics_size.nim 444 B

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