Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #9940; genericAssign does not take care of the importC variables in refc [backport] #23761

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

ringabout
Copy link
Member

fixes #9940

@Araq Araq added the merge_when_passes_CI mergeable once green label Jun 26, 2024
@ringabout
Copy link
Member Author

  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 #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.

@Araq
Copy link
Member

Araq commented Jun 26, 2024

Yeah we need to fix Atomic[T] indeed, it's nuts.

@Araq Araq merged commit 828cd58 into devel Jun 26, 2024
18 checks passed
@Araq Araq deleted the pr_vm_gcc14 branch June 26, 2024 16:24
Copy link
Contributor

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from 828cd58

Hint: mm: orc; opt: speed; options: -d:release
179022 lines; 8.513s; 664.703MiB peakmem

narimiran pushed a commit that referenced this pull request Jun 26, 2024
…s in refc [backport] (#23761)

fixes #9940

(cherry picked from commit 828cd58)
narimiran pushed a commit that referenced this pull request Jun 27, 2024
…s in refc [backport] (#23761)

fixes #9940

(cherry picked from commit 828cd58)
narimiran added a commit that referenced this pull request Jul 9, 2024
…variables in refc [backport] (#23761)"

This reverts commit fda43d1.
metagn added a commit to metagn/Nim that referenced this pull request Sep 23, 2024
metagn added a commit to metagn/Nim that referenced this pull request Sep 30, 2024
metagn added a commit to metagn/Nim that referenced this pull request Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge_when_passes_CI mergeable once green
Projects
None yet
Development

Successfully merging this pull request may close these issues.

genericAssign does not take care of the importC variables
2 participants