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

Lazy initialize gmp and mpfr finalizers #17010

Merged
merged 1 commit into from
Jun 19, 2016
Merged

Lazy initialize gmp and mpfr finalizers #17010

merged 1 commit into from
Jun 19, 2016

Conversation

yuyichao
Copy link
Contributor

@yuyichao yuyichao commented Jun 19, 2016

cglobal is done at codegen time not runtime so there's no need to use a global variable for these.

This also make the finalizer call type stable and makes construction of BigFloat and BigInt 5-20% faster.

This will cause a minor behavioral change when the symbol can't be found. In the old version, it would print an warning at init time and silently ignore the error at runtime, In the new version, it will raise a runtime error.
Given that all of these are only in try-catch after #12742, I assume we don't support a version of gmp that doesn't have these symbols and a runtime error should be better (if it is at all possible to have the init symbol but not the clear symbol....).

@yuyichao yuyichao merged commit 0f30900 into master Jun 19, 2016
@yuyichao yuyichao deleted the yyc/global-init branch June 19, 2016 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant