Re: alignment of data-types

"Glen Herrmannsfeldt" <>
12 Feb 2003 13:39:28 -0500

          From comp.compilers

Related articles
Re: alignment of data-types (Glen Herrmannsfeldt) (2003-02-06)
Re: alignment of data-types (2003-02-11)
Re: alignment of data-types (Mark McIntyre) (2003-02-11)
Re: alignment of data-types (Glen Herrmannsfeldt) (2003-02-12)
| List of all articles for this month |

From: "Glen Herrmannsfeldt" <>
Newsgroups: comp.lang.c,comp.compilers
Date: 12 Feb 2003 13:39:28 -0500
Organization: AT&T Broadband
References: <3e3fbe78$0$49117$> <> 03-02-033 03-02-054
Keywords: architecture, performance
Posted-Date: 12 Feb 2003 13:39:27 EST

"Mark McIntyre" <> wrote in message
> On 6 Feb 2003 00:16:31 -0500, in comp.lang.c , "Glen Herrmannsfeldt"
> <> wrote:
> >"Mark McIntyre" <> wrote in message
> >> You have little or no chance of being better at it than the guys who
> >> wrote it, at least not till you're a guru programmer, by which stage
> >> you won't need to ask us for advice....
> >
> >Should, but not always true.
> >
> >It is common for x86 compilers to allocate double variables on 4 byte
> >boundaries. This was optimal on the 386 and 486, but not on pentium
> >and later processors. The difference can be large.
> Indeed. But by the time hte OP truly understands why that is so, he
> for sure won't need to ask questions in CLC. Hence the 2nd part of my
> remark.

True, but even worse is doing profiling and having the alignment change

The one I was originally writing about is the pointer returned by malloc().
Structure alignment is a different question. malloc() alignment could
easily change with only a small change in a program, or even no change at

-- glen

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.