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

Codegen init regression #10148

Closed
cooldome opened this issue Dec 31, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@cooldome
Copy link
Member

commented Dec 31, 2018

I have introduced regression. There is a use case when initialized GC is required in datInit procs.
Test case that previously worked:

proc findlib: string =
  # I am using GC allocations
  let path = getEnv("MYLIB")
  if dirExists(path): path / "alib.dll"
  else: alib.dll"

proc imported_func*(a: cint): cstring {.importc, dynlib: findlib().}

I provide a fix. The following change will need to be revisited

Previously, init calls where made int this order: systemDatInit, init TLS, init GC, systemInit, other modules dataInit, other modules init. In order to achieve item 3, I have changed it to:
calls all modules datInit, init TLS, init GC, call all modules init. System module is the first module in the all modules lis

cooldome added a commit to cooldome/Nim that referenced this issue Dec 31, 2018

@Araq Araq closed this in 7c90e22 Dec 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.