| ▲ | matheusmoreira 2 hours ago | |||||||||||||||||||||||||
Any reason the hardware pointer can't be accessed via the packed structure? | ||||||||||||||||||||||||||
| ▲ | saagarjha an hour ago | parent | next [-] | |||||||||||||||||||||||||
The same reason you probably aren’t adding manual alignment fixes to your code? | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ▲ | bluGill an hour ago | parent | prev [-] | |||||||||||||||||||||||||
however you certainly can do that. The point of unaligned is the hardware can't load it from a single memory location in one address. It needs two accesses. And in that time, the value of one of the two addresses that the hardware has to load can change. I would hope you're not so stupid as to design hardware that relies on this, but the fact is it certainly is possible for someone to do that. And if you do that, there is nothing that the compiler or the standard can do. It can't be done correctly | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||