lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 18 March 2018 at 20:49, Petri Häkkinen <petrih3@gmail.com> wrote:
>
> Ok, here’s another try. I started from scratch and only added “truearray” and “sizeused” fields to the Table struct. Operator # uses sizeused field in the case of a true array (a table created with table.newarray()), so that it becomes O(1).
>
> Also, I’m not sure if luaC_barrierback() should be called when updating the array in luaH_newkey()?
>

Believe so. My understanding is that when a key is added, the table if
black must be turned to gray as black objects cannot point to white
objects. luaC_barrierback() does that.

Regards
Dibyendu