Re: External Memory
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Wed, 9 Sep 2009 16:27:46 -0500 (CDT)
Dag-Erling Smørgrav <des@xxxxxx> writes:
Ray Kulhanek <kulhanek.5@xxxxxxxxxx> writes:
James Kuyper <jameskuyper@xxxxxxxxxxx> writes:
Ensuring that the pieces are always suitably aligned cannot be doneTrue. I hadn't thought of that. But again, if it's just an
portably, though there are ways of substantially reducing the
likelihood that the pieces are misaligned.
experiment, would it need to be portable? He could google the rules
used by his specific machine and follow them.
On most modern systems, it is safe to assume that the correct alignment
for any scalar type T is sizeof(T) rounded up to the nearest power of
two.
It's probably safe to assume that that's *a* correct alignment,
but not that it's *the* correct alignment. For example, on my
system (x86 Linux, gcc), types long, long long, double, and long
double all have 4-byte alignment, though their sizes are 4, 8, 8,
and 12, respectively.
Well, I suppose it's safe to assume in the sense that being wrong
won't hurt anything.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
--
comp.lang.c.moderated - moderation address: clcm@xxxxxxxxxxxx -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
.
- Follow-Ups:
- Re: External Memory
- From: Dag-Erling Smørgrav
- Re: External Memory
- References:
- Re: External Memory
- From: James Kuyper
- Re: External Memory
- From: Ray Kulhanek
- Re: External Memory
- From: Dag-Erling Smørgrav
- Re: External Memory
- Prev by Date: Re: getch() Problem?
- Next by Date: Re: value rollup detection at runtime
- Previous by thread: Re: External Memory
- Next by thread: Re: External Memory
- Index(es):
Relevant Pages
|