[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: what is the role of the `seed` field in the Lua global state?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 12 Mar 2020 11:39:07 -0300
> Is there any way to specify a seed when I create a new lua VM ? It's
> very useful for reproduction of bugs .
> If the seed is always random, the order of table iteration would be
> different every time.
Setting the seed is not enough to ensure reproduction of execution: if
your table contains functions or userdata as keys, then the order is
undefined because Lua uses memory addresses to compute key hashes when
keys are functions and userdata.