From: Samuel Tardieu <sam@rfc1149.net>
Subject: Re: A curiosity...
Date: Fri, 05 Dec 2008 09:02:21 +0100
Date: 2008-12-05T09:05:02+01:00 [thread overview]
Message-ID: <87r64naw36.fsf@willow.rfc1149.net> (raw)
In-Reply-To: 396044ea-4c37-4923-b989-eb4af2202bd3@o2g2000yqd.googlegroups.com
>>>>> "Ludovic" == Ludovic Brenta <ludovic@ludovic-brenta.org> writes:
Ludovic> And I think this rule is responsible for the "limitation"
Ludovic> that all current processor architectures use addresses which
Ludovic> are the same size as integers. Before the advent of C,
Ludovic> address size and word size were not necessarily the same; now
Ludovic> they always are, and that's *only* for compatibility with C.
Certainly not. For example, on a x86_64 Linux machine with GCC, you
can try the following snippet (untested):
#include <stdio.h>
int main()
{
printf("integer size is %d, pointer size is %d\n",
sizeof(int), sizeof(void*));
return 0;
}
You should get respectively 4 and 8.
Ludovic> Nowadays, computers are moving towards non-uniform memory
Ludovic> architectures (e.g. main memory, video memory, network
Ludovic> interface cache memory, physics processor memory, etc.) which
Ludovic> would map extremely well to Ada's storage pools and very
Ludovic> poorly with C's pointer arithmetic.
Nah, this is a FUD. If you want to use an integer type in C which is
compatible with addresses, you should use "size_t" explicitely, not
any other integer type (though I know of no architecture where
"unsigned long" is not the same as "size_t" even though this is
allowed).
Sam
--
Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/
next prev parent reply other threads:[~2008-12-05 8:02 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-04 20:47 A curiosity mockturtle
2008-12-04 21:17 ` Adam Beneschan
2008-12-04 21:48 ` Hyman Rosen
2008-12-04 22:04 ` Ludovic Brenta
2008-12-04 22:10 ` Ludovic Brenta
2008-12-04 22:24 ` Hyman Rosen
2008-12-05 8:02 ` Samuel Tardieu [this message]
2008-12-05 11:51 ` Peter C. Chapin
2008-12-05 13:09 ` Martin Krischik
2008-12-05 15:15 ` Hyman Rosen
2008-12-06 13:26 ` Peter C. Chapin
2008-12-05 16:37 ` Keith Thompson
2008-12-04 22:19 ` Hyman Rosen
2008-12-05 9:03 ` Georg Bauhaus
2008-12-04 22:30 ` Randy Brukardt
2008-12-04 22:57 ` Hyman Rosen
2008-12-05 16:42 ` Keith Thompson
2008-12-05 16:57 ` Hyman Rosen
2008-12-05 20:20 ` Keith Thompson
2008-12-05 20:59 ` Adam Beneschan
2008-12-06 22:53 ` Hyman Rosen
2008-12-06 23:15 ` Gary Scott
2008-12-08 15:39 ` Hyman Rosen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox