I want to print the memory cell (address) of a variable with:
let x = 1; println!("{:p}", &x);
This prints the hex value 0x7fff51ef6380 , which is in decimal format 140734568031104 .
My computer has 16 GB of RAM, so why is this a huge amount? Does the x64 architecture use a large interval sequence instead of a simple 1 increment to access a memory location?
On x86, usually the first place starts with 0, then 1, 2, etc., so the largest number you can have is about 4 billion, so the address number is always equal to or less than 4 billion.
Why is this not true with x64?
memory rust
John smith
source share