From: Robert Love <rml@novell.com>
To: Fawad Lateef <fawad_lateef@yahoo.com>
Cc: ncunningham@linuxmail.org, linux-mm@kvack.org
Subject: Re: Is sizeof(void *) ever != sizeof(unsigned long)?
Date: Sat, 04 Dec 2004 16:32:41 -0500 [thread overview]
Message-ID: <1102195961.6052.71.camel@localhost> (raw)
In-Reply-To: <20041204170217.45200.qmail@web53908.mail.yahoo.com>
On Sat, 2004-12-04 at 09:02 -0800, Fawad Lateef wrote:
> The sizeof(<pointer>) is always of 32bits or 4bytes on
> x86 Architecture, and you can say that it is actually
> the virtual address size of the Architecture. And
> unsigned long is actually what I understand is the
> size which a single architecture can address in a
> single atempt, like roughly you can say that in x86
> architecture long can be accesses in single cycle.
I think the term that you want is "word size" -- you want to say that a
C long type is guaranteed to be the word size, which is generally the
size of a single GPR.
But that is not true, actually. Nothing in C or anywhere else says that
the long type has to be the size of a GPR. Specifically in Linux, the
SPARC64 user-space ABI has a 32-bit long type despite being a 64-bit
architecture--in other words, SPARC64 has a 32-bit user-space even
though it is a 64-bit architecture.
In the kernel, however, we have the ABI such that both pointers and
longs are the same size, generally the size of the GPR. But there is a
difference between physical requirements, C requirements, the user-space
ABI, and the kernel ABI.
> By defination, they can be not equal to each other but
> practically it is same .........
By definition (the Linux kernel ABI) they _are_ equal in size to each
other.
Robert Love
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
prev parent reply other threads:[~2004-12-04 21:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-04 10:40 Nigel Cunningham
2004-12-04 16:26 ` Robert Love
2004-12-04 21:14 ` Nigel Cunningham
2004-12-04 17:02 ` Fawad Lateef
2004-12-04 21:32 ` Robert Love [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1102195961.6052.71.camel@localhost \
--to=rml@novell.com \
--cc=fawad_lateef@yahoo.com \
--cc=linux-mm@kvack.org \
--cc=ncunningham@linuxmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox