C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Standardising 0xdeadbeef for pointers

From: Thiago Macieira <thiago_at_[hidden]>
Date: Fri, 25 Jul 2025 12:33:41 -0700
On Friday, 25 July 2025 05:19:41 Pacific Daylight Time Frederick Virchanza
Gotham via Std-Proposals wrote:
> Not really. There isn't a computer in existence today -- I don't think
> -- that uses more than 49 bits for a memory address. 64-Bit ARM uses
> 48 bits but it can be extended by 1 bit to 49 bits.

x86 can do 57 bits of linear memory address, so your information is out of
date by about 5 years. And there's nothing in the *architecture* that would
impose the limit, so it the limit could be extended with other addressing
modes (at the expense of allowing fewer bits for the pointer colouring).

Of course, with pointer colouring a.k.a. Linear Address Masking, the bits 48
to 62 or 63 *are* available. They are aliased to something else that doesn't
have the bits set, but they are valid.

Linux only guarantees the first and last pages are forever inaccessible.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Platform & System Engineering

Received on 2025-07-25 19:33:48