Re: Unaligned memory access

Roberto Ierusalimschy <[email protected]>
Newsgroups gmane.comp.lang.lua.general
Message-ID <[email protected]>
> 
> I think what they meant is you can pass a custom allocator function in 
> lua_newstate() instead of the default one provided by luaL_newstate()
> 
> I don't think that will guarantee 16-bit alignment for the userdata, since 
> the userdata has a header that might cause the actual space for the 
> userdata to fall into an 8-bytes boundary. 

That is the whole point of LUAI_MAXALIGN: Lua ensures that all types in
that macro are properly aligned inside a userdata, after the header.
Lua uses the macro to ensure the header behaves correctly.

-- Roberto

-- 
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/20260217175413.GB188102%40arraial.inf.puc-rio.br.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.