You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am storing a randomiser variable of type std.rand.Random in a struct. Whenever I use that randomiser to get a random number, it corrupts memory after it in the struct.
I am able to get around this by changing the type stored in the struct to std.rand.DefaultPrng, so I am not sure whether I am making some mistake by storing a std.rand.Random, or whether this is actually a bug. I also tried this with std.rand.DefaultCsprng, and while there was no memory corruption in that case, it did lead to a segmentation fault may mean that there is a bug there as well.
I am using zig version zig-windows-x86_64-0.9.0-dev.71+138afd5cb
Thanks,
The text was updated successfully, but these errors were encountered:
I am storing a
randomiser
variable of typestd.rand.Random
in a struct. Whenever I use that randomiser to get a random number, it corrupts memory after it in the struct.Output:
I am able to get around this by changing the type stored in the struct to
std.rand.DefaultPrng
, so I am not sure whether I am making some mistake by storing astd.rand.Random
, or whether this is actually a bug. I also tried this withstd.rand.DefaultCsprng
, and while there was no memory corruption in that case, it did lead to a segmentation fault may mean that there is a bug there as well.I am using zig version
zig-windows-x86_64-0.9.0-dev.71+138afd5cb
Thanks,
The text was updated successfully, but these errors were encountered: