[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Maximum alignment question
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 16 Feb 2009 10:06:53 -0300
> 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).
-- Roberto