--- Dennis Cote <[EMAIL PROTECTED]> wrote: > Joe Wilson wrote: > > > > If an external interface changed, sure. But these internal structs > > change constantly from (minor) release to release. > > > > The struct in question is used solely by btree.c, so the ordering > > and layout for bit fields on different compilers or different platforms > > do not matter. > > > > > Joe, > > Yeah, for strictly internal memory based structures, I can't see a > problem. I wasn't sure if these were ever written to disk.
Writing structs' memory directory to disk is not portable, whether bit fields are used or not. > One other issue that might have been a problem is that you can't get the > address of a bitfield. Since you have successfully compiled the code > using bitfields, there must not be any code that tries to get a pointer > to any of these fields. > > Your test seems to show these changes don't have any adverse performance > impact either. > > You may want to look at how the isInited field is used. You may be able > to combine it with the others as long as it stays in the first byte and > the code only checks for zero vs nonzero values on that byte (then again > that may not be safe if other combined bitfield are set nonzero before > the isInited field is set). If its safe, you could save another byte per > structure. Generally structs are aligned on 8-byte boundaries, so making isInited a bitfield wouldn't save any additional space in this particular case. ____________________________________________________________________________________ Don't pick lemons. See all the new 2007 cars at Yahoo! Autos. http://autos.yahoo.com/new_cars.html ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------