[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: C string pointers to Lua
- From: Rebel Neurofog <rebelneurofog@...>
- Date: Tue, 12 Oct 2010 15:22:53 +0400
> And I'd be slightly shocked if it didn't already do the pointer comparison before jumping into byte comparisons.
In this case pointers will never be equal and and it will always jump
into byte comparisons.
> You can do this already, except for the check for uniqueness:
> #define lua_loadstrconst(L,s) s=lua_pushstring(L,s)
> You also need to ensure that the strings do not get garbage collected,
> e.g., save them in the registry or some other global table.
Cool, that's even better. I didn't notice that since it is Lua 5.2 feature.