Upvalues vs C static variable
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Upvalues vs C static variable
- From: Albert Chan <albertmcchan@...>
- Date: 2018年4月13日 10:24:53 -0400
When to use lua upvalue mechanism instead of simpler C static variable ?
Example, lua 5.4 work-1 math.random :
It uses upvalue to store the 128-bits random state.
Why not use static uint64_t state[2] ?