#define MACHINE_ALIGN (was: killer query)

Lowden, James K LowdenJK at bernstein.com
Tue Jun 25 11:14:48 EDT 2002


> From: ZIGLIO Frediano [mailto:Frediano.Ziglio at vodafoneomnitel.it]
> Sent: June 25, 2002 4:18 AM
> >
> > +  709          /* actually this 4 should be a machine 
> > dependent #define */
> > +  710          remainder = info->row_size % 4;
> > +  711          if (remainder) info->row_size += (4 - remainder);
> 
> Instead of 4 a macro like
> 
> #define MACHINE_ALIGN (sizeof(void*) > sizeof(int) ? sizeof(void*) :
> sizeof(int) )
> 
> should be enough.

Frediano, 

Hmm.  Good point.  Let me ask, then, is there any reason that  

	#define MACHINE_ALIGN sizeof(void*)

wouldn't be enough?  Is there an architecture on the planet that has an int
smaller than an address?  That is, isn't 

	sizeof(void*) >= sizeof(int) 

always always always true?

I thought this sort of thing would fall out of ./configure somewhere and
there would be predefined alignment macro.  

I'd really rather let the compiler and autoconf et. al. deal with this,
which is why I like your suggestion better than a magic "4".  

--jkl



More information about the FreeTDS mailing list