C++ Logo

std-proposals

Advanced search

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

From: connor horman <chorman64_at_[hidden]>
Date: Fri, 25 Jul 2025 14:30:49 -0400
On Fri, 25 Jul 2025 at 08:19, Frederick Virchanza Gotham via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> On Fri, Jul 25, 2025 at 1:03 PM Andrey Semashev wrote:
> >
> > There is only one pointer value that is guaranteed to not point at any
> > object, and that's nullptr. If you want to add another one, that would
> > have to go beyond just defining a new constant. The whole runtime
> > (including but not limited to the memory allocator) would have to be
> > updated with support for this new constant.
>
>
> 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.
>
> Since 2022, Intel has specified LA57, or 5-level paging, which uses a
57-bit virtual address. This is consistent with the design for the original
amd64, which used the canonical address requirement to guard against
userspace code being incompatible with further virtual address extensions.
I believe Intel Server chips supporting this feature came out either this
year, or will next year.

Received on 2025-07-25 18:31:03