lua-users home
lua-l archive

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

Am Sa., 29. Juli 2023 um 00:23 Uhr schrieb Gerhard Sittig
> ARM processors at least since v7, probably before that, support
> misaligned memory access. May cost a few extra cycles, but works
> transparently. That's why developers don't notice.

That's correct concerning data, as ARM strictly does not do
calculation operations directly on "normal RAM" (this is quite a
contrast to many other "more tricky / interrupt-timing-optimized"
Microcontroller CPU architectures like older Microchip PIC
architectures e. g.), but any data is first loaded to the registers,
and all cacluation work is done using the  ca.16 32bit registers (+
ca. 32 32bit floating point registers, which may be paired for double

But if any data contains pointers, then of course these pointers MUST
point to aligned data (or at least "32 bit portitioned" data), if this
data is assumed to be "directly usable for calculation", Therefore e.
g. userdata should be aligned, and internal Lua "work structs" like
TValue or all "further up things" like TString also must be aligned...