64 bit->48 bit pointer hacks...
- To: debian-amd64@lists.debian.org
- Subject: 64 bit->48 bit pointer hacks...
- From: "Dale E. Martin" <dale@the-martins.org>
- Date: Mon, 3 Oct 2005 08:49:13 -0400
- Message-id: <[🔎] 20051003124913.GA26113@the-martins.org>
- In-reply-to: <cd8ecdef0509301413n2d9b34eep9370f8d696f6a622@mail.gmail.com>
- References: <Pine.LNX.4.62.0509301502560.5092@Chrestomanci> <20050930195357.GE20089@csclub.uwaterloo.ca> <ir47jcy8eba.fsf@minos.phy.bnl.gov> <cd8ecdef0509301413n2d9b34eep9370f8d696f6a622@mail.gmail.com>
> The current generation AMD64 MMUs can only handle 64-bit pointers in
> which the high-order 17 bits are all the same (40 bits of information).
I was mulling this over the other day... Say I've got a string class that
looks like this:
class string {
class shortString {
char flag;
char [7] smallString;
};
class {
union {
char *ptr;
shortString;
} shortStringOrPtr;
} data;
};
Is there some magic value I can write into "flag", that in combination with
the understanding of how 64 bit pointers get truncated down to 48 bit
virtual addresses that will allow me to store either a 7 byte string or a
char * in the same space?
Thanks,
Dale
--
Dale E. Martin - dale@the-martins.org
http://the-martins.org/~dmartin
Reply to: