It doesn't matter so much on 68k, but on some other platforms (ARM) unaligned access is significantly slower than aligned access. So unless you have a particular reason to pack the struct, you'd be better off not packing it and using sizeof().
-joe > -----Original Message----- > From: Brian Smith [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 24, 2002 2:04 PM > To: Palm Developer Forum > Subject: RE: record size and writing to database > > > On Wed, 24 Apr 2002, Schettino, John wrote: > > > I believe > > #pragma packed > > Not with GCC... in that case you need to put the following at > the end of > every variable (and in the case of structures, after each member I > believe): > > __attribute__ ((__packed__)) > > Ex: > > int nVersion __attribute ((__packed__)); > > Naturally, it's easier to use a #define to save a ton of typing :-) > > -------------------------------------------------------------- > --------- > Brian Smith // avalon73 at arthurian dot nu // > http://www.arthurian.nu/ > Software Developer // Gamer // Webmaster // System > Administrator > Friends don't let friends wear Speedos. Ever. > > > > -- > For information on using the Palm Developer Forums, or to > unsubscribe, please see http://www.palmos.com/dev/support/forums/ > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
