[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Comparing the binary chunk of two functions for equality
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 19 Feb 2014 07:30:39 -0300
> luaL_loadstring( L, s1.c_str() );
luaL_loadstring(L,s) is equivalent to luaL_loadbuffer(L,s,strlen(s),s).
The 4th argument to luaL_loadbuffer is the source and this gets saved
by lua_dump. No wonder the binary chunks are different.
So, instead of luaL_loadstring(L,s1.c_str()), use
luaL_loadbuffer(L, s1.c_str(), s1.length(), "=name")
to give the chunks the same "source".