3 ms·
First, pointers are typically unsigned integers. Second, memory addresses are virtual, they don't have to exist physically. That is, you don't have to physicall
by infogulch 12y ago
First, pointers are typically unsigned integers. Second, memory addresses are virtual, they don't have to exist physically. That is, you don't have to physically have up through 2 quintillion addressable bytes for a pointer with that value to be valid. This is especially true with Address Space Layout Randomization (ASLR) security techniques employed by operating systems.
tl;dr: all valid pointer values are possible, regardless of how much memory you actually have.
- TheLoneWolfling 12y agoSo then store the pointer implicitly right-shifted by 1. Means that boxed access is slower, but unboxed access is faster. And, when you get down to the assembly level, it doesn't matter - you can treat an unsigned integer as signed for a comparison if it makes things easier.