> What do you think the size of this structure is? It should be 4 bytes, right?
Of course not! Ever heard of this "memory alignment" thing? There even were
architectures where accessing an unaligned int would get you SIGBUS
(Solaris/SPARC was one, from what I remember). Have you never wondered where
all the unix signals came from?
3 comments
[ 5.2 ms ] story [ 13.0 ms ] threadOf course not! Ever heard of this "memory alignment" thing? There even were architectures where accessing an unaligned int would get you SIGBUS (Solaris/SPARC was one, from what I remember). Have you never wondered where all the unix signals came from?
[1] Hey lets make the memory layout look like Swiss Cheeze and increase the pressure on the cache! It'll totally be faster!!!