Bug#642762: xulrunner-6.0: console flooded with unaligned access messages on ia64 (IA-64/IPF/Itanium) platform
Émeric Maschino
emeric.maschino at gmail.com
Thu Oct 6 12:25:53 UTC 2011
2011/10/6 Mike Hommey <mh at glandium.org>:
> On Thu, Oct 06, 2011 at 12:21:29AM +0200,
>
> That would waste a 64-bits word. The usual way to do it is to use
> unions:
> union {
> PRUint64 dummy;
> struct {
> PRUint32 m0;
> PRUint16 m1;
> PRUint16 m2;
> };
> };
Thanks for pointing this out. I've never seen such a construction before.
BTW, what's better/cleaner? Align nsID or adapt Equals to make 32-bit
words comparison? Is the following code OK:
inline PRBool Equals(const nsID& other) const {
return
((PRUint32*) &m0)[0] == ((PRUint32*) &other.m0)[0] &&
((PRUint32*) &m1)[0] == ((PRUint32*) &other.m1)[0] &&
((PRUint32*) &m3)[0] == ((PRUint32*) &other.m3)[0] &&
((PRUint32*) &m3)[1] == ((PRUint32*) &other.m3)[1];
}
Emeric
More information about the pkg-mozilla-maintainers
mailing list