Segher Boessenkool wrote:
It would be better if GCC had a 'nopadding' attribute which gave us what
we need without the _extra_ implications about alignment.
That's impossible; removing the padding from a struct
_will_ make accesses to its members unaligned (think
about arrays of that struct).
And many platforms happily support unaligned CPU access in hardware at a
price in performance, while other support it in software at great cost
in performance. None of that maps into impossible, Some i/o hardware may
not support at all and require some bounce buffering, at cost in memory
and CPU.
None of that equates with impossible. It is readily argued that it could
mean inadvisable on some architectures, slow as government assistance
and ugly as the north end of a south-bound hedgehog, but it's not
impossible.
Do NOT take this to mean I think it would be a good thing in a Linux
kernel, or that it should be added to gcc, but in some use like embedded
applications where memory use is an important cost driver, people are
probably doing it already by hand to pack struct arrays into minimal
bytes. It's neither impossible nor totally useless.
--
bill davidsen <davidsen@xxxxxxx>
CTO TMR Associates, Inc
Doing interesting things with small computers since 1979
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html