> 在 2020年3月12日，22:39，Luiz Henrique de Figueiredo <email@example.com> 写道：
>> 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.
There is another reason that I want to set the seed by myself.
Our system use thousands lua VMs in one process. I make a small patch to share the function protos (including strings) among these VMs. So I need these VMs use the same seed, so that the strings’ hash can be used in any of these VM.
If you're already patching the VM, it shouldn't be hard to just patch the seed assignment yourself.