Closed ringabout closed 2 days ago
type
Atomic*[T] {.importcpp: "std::atomic", completeStruct.} = object
## An atomic object with underlying type `T`.
raw: T
std/atomics
uses a non-existent field for importc types. It has caused troubles for ORC. After this PR, it won't work for refc with C++ backend as well.
ref https://github.com/nim-lang/Nim/issues/12726
type Atomic*[T]{.importcpp: "std::atomic", size:sizeof(T).} = object
It would be great to have this instead. Otherwise contrived fields really hurt the interoperability with c/cpp backends. std/atomics
is broken for ORC with cpp backend already.
Yeah we need to fix Atomic[T]
indeed, it's nuts.
Thanks for your hard work on this PR! The lines below are statistics of the Nim compiler built from 828cd58d8a0376a5b7a6ad58d73d66617b37629a
Hint: mm: orc; opt: speed; options: -d:release 179022 lines; 8.513s; 664.703MiB peakmem
fixes #9940