Re: Performance implications of large FFI constants

  • From: Justin Cormack <justin@xxxxxxxxxxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 26 Sep 2012 10:32:56 +0100

On Wed, Sep 26, 2012 at 9:59 AM, Pierre Chapuis <catwell@xxxxxxxxxxxx> wrote:
> I tend to use the later case but I use tables for namespaces instead of a
> prefix and an underscore (after all we have a real namespacing mechanism
> in Lua...).
>
> That means:
>
> -- library code
>
>     return {
>       MWMO = {
>         ALERTABLE = ...,
>         INPUTAVAILABLE = ...,
>       }
>     }
>
> -- client code
>
>     local MWNO = U32.MWNO
>     local dwFlags = bor(MWMO.ALERTABLE, MWMO.INPUTAVAILABLE)

Yes, I will probably change to namespacing by tables at some point, it
is more idiomatic, but still using the strings.

Justin

Other related posts: