mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
rand: fix leaks with -autofree
This commit is contained in:
@@ -22,6 +22,12 @@ mut:
|
||||
extra u32
|
||||
}
|
||||
|
||||
// free should be called when the generator is no longer needed
|
||||
[unsafe]
|
||||
pub fn (mut rng WyRandRNG) free() {
|
||||
unsafe { free(rng) }
|
||||
}
|
||||
|
||||
// seed sets the seed, needs only two `u32`s in little-endian format as [lower, higher].
|
||||
pub fn (mut rng WyRandRNG) seed(seed_data []u32) {
|
||||
if seed_data.len != 2 {
|
||||
|
||||
Reference in New Issue
Block a user