How are Lua tables handled in memory?
问题 How does lua handle a table's growth? Is it equivalent to the ArrayList in Java? I.e. one that needs continuous memory space, and as it grows bigger than the already allocated space, the internal array is copied to another memory space. Is there a clever way to led with that? My question is, how is a table stored in the memory ? I'm not asking how to implement arrays in Lua. 回答1: (Assuming you're referring to recent versions of Lua; describing the behavior of 5.3 which should be (nearly?) the