Skip to content

rand.mt19937: relax data for -autofree, update test#26266

Merged
spytheman merged 1 commit into
vlang:masterfrom
tankf33der:mt
Jan 6, 2026
Merged

rand.mt19937: relax data for -autofree, update test#26266
spytheman merged 1 commit into
vlang:masterfrom
tankf33der:mt

Conversation

@tankf33der

@tankf33der tankf33der commented Jan 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #13398

When operating in -autofree mode, memory errors that should not occur are detected.
Other generators are not affected by this.

  1. rng.state = calculate_state(seed_data, mut rng.state) - if one is already being modified, then there's no need to return it.
  2. mut rnd := &rand.PRNG(&mt19937.MT19937RNG{}) - the usage principle is copied from another generator's test

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @tankf33der 🙇🏻 .

@spytheman spytheman merged commit 9e1ea47 into vlang:master Jan 6, 2026
73 of 74 checks passed
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.

Abort in mt19937 using autofree engine

2 participants