freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "Lowden, James K" <LowdenJK AT bernstein.com>
- To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
- Subject: #define MACHINE_ALIGN (was: killer query)
- Date: Tue, 25 Jun 2002 10:14:48 -0400
> 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
- #define MACHINE_ALIGN (was: killer query), Lowden, James K, 06/25/2002
Archive powered by MHonArc 2.6.24.