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

[C] Fix aeron_randomised_int32 on Windows #854

Merged
merged 1 commit into from
Feb 13, 2020

Conversation

ltrzesniewski
Copy link
Contributor

The media driver always produced the same sequence of session IDs.

  • rand() was apparently not seeded properly (yet it should have been, I need to check why)
  • rand() * INT_MAX would always cause an overflow
  • This uses rand_s instead of rand for better randomness and to avoid the dependency on a seed (it better aligns to what is done on other platforms)

 - rand() was not seeded and always produced the same sequence
 - rand() * INT_MAX would always cause an overflow
 - Use rand_s instead of rand for better randomness
   and to avoid the dependency on a seed
@tmontgomery
Copy link
Contributor

Will merge once checks pass.

@tmontgomery tmontgomery merged commit 6425b6e into real-logic:master Feb 13, 2020
@ltrzesniewski ltrzesniewski deleted the fix-rand branch February 13, 2020 18:06
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.

2 participants