lua-users home
lua-l archive

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

On Mon, Nov 21, 2011 at 2:15 PM, Leo Razoumov <> wrote:
An elegant idea, indeed! And  'self' reference is avoided.

thx :)

There is one problem, though.
Every time you create a new object instance brand new closures for all
your instance methods are created as well. In case you have many small
objects it can cost you memory and also CPU.

Yeah, that is true. The system is mainly meant for large objects of which relatively few are created at runtime.

In my case, it's for the whole Mobile Lua engine core. Which has a lot of code and few instances (usually just one, but we want to have the option of creating more if needed).