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

Issue #20062: make Random.reserve type-stable #22446

Merged
merged 3 commits into from
Jun 24, 2017
Merged

Issue #20062: make Random.reserve type-stable #22446

merged 3 commits into from
Jun 24, 2017

Conversation

GregPlowman
Copy link
Contributor

@GregPlowman GregPlowman commented Jun 20, 2017

Issue #20062

Not a performance issue, but does pollute @code_warntype for functions that include rand().

Also thought that returning nothing better documents that return value is not used.

@Sacha0
Copy link
Member

Sacha0 commented Jun 20, 2017

(CI failures were timeouts except AV i686, which looks like an unrelated compile test failure?)

test/random.jl Outdated
@test !Base.Random.mt_empty(r); @inferred Base.Random.reserve_1(r)

rand(r)
@test 0 < Base.Random.mt_avail(r) < Base.Random.MTCacheLength; @inferred Base.Random.reserve(r, Base.Random.mt_avail(r))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these seem like two separate tests, and go over the line length recommendation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was probably being overly-cautious with these tests, trying to test inferred return type on different conditions of mt_avail. Probably sufficient to test once only. Will update to simplify.

@rfourquet rfourquet added compiler:inference Type inference domain:randomness Random number generation and the Random stdlib labels Jun 21, 2017
Copy link
Member

@rfourquet rfourquet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@rfourquet rfourquet merged commit 7b14c5e into JuliaLang:master Jun 24, 2017
DrTodd13 pushed a commit to IntelLabs/julia that referenced this pull request Jun 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:inference Type inference domain:randomness Random number generation and the Random stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants