lua-users home
lua-l archive

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

> I think you could add a mininum table allocation size (or minumum
> allocated entries at table creation) macro in 'luaconf.h'. Because
> we're not limited by memory constraints, we'd happily set this
> value to 8 or 16 if it existed, so we can save time from
> reallocations. But I'm not so sure about this, since I guess we could
> just optimize our code ;)

You may want to try the _very_dirty_hack_ of creating your tables like

  t = {nil,nil,nil,nil,nil,nil,nil,nil,nil,nil}

In this way, the table is created with eight (empty) slots.

-- Roberto