lua-users home
lua-l archive

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


On Mon, Feb 16, 2009 at 3:06 PM, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> Bogdan Marinescu wrote:
>> Thank you, I understood that. The part that I don't understand is why
>> does the string have to be fully aligned.
>
>> From the reference manual "lua_tolstring returns a fully aligned
>> pointer to
> a string inside the Lua state.".
>
> I imagine the reason this is guaranteed is so that strings can contain
> binary data - structs etc.  Useful when looking up cached values in
> tables for example, - would also allow specialised high speed string
> functions to be written which both know the length of the string, and
> that it's aligned.

Mostly the first reason (strings containing binary data).

Thanks, I got it now.

Best,
Bogdan
 


-- Roberto