C++ Logo

std-proposals

Advanced search

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

From: zxuiji <gb2985_at_[hidden]>
Date: Thu, 31 Jul 2025 16:08:51 +0100
So we're designing for lala land where any and all silly systems exist are
we? Just define a minimum based on real world standards which as far as I'm
aware is 512 minimum which is reasonable enough for a `MIN_PAGE_SIZE 512`
macro and certainly reasonable for a `MAX_INVALID_ADDRESS ((void*)512)`
macro

On Thu, 31 Jul 2025 at 15:49, Thiago Macieira <thiago_at_[hidden]> wrote:

> On Thursday, 31 July 2025 07:35:31 Pacific Daylight Time zxuiji wrote:
> > Then the answer to the potential null+-1 being valid is simple, mandate
> in
> > the next standard that the 0+-PAGE_SIZE be premapped as sealed no rwx
> > pages. That resolves the problem completely. They don't need to have
> > anything mapped to them, just that they be mapped as invalid.
>
> There's no PAGE_SIZE in the standard. Nor in POSIX, for that matter. POSIX
> only has a runtime requirement for sysconf(_SC_PAGESIZE), with no required
> minimum.
>
> Without a minimum, there could hypothetically be a system with a page size
> of
> 1, which means the change you're proposing is useless.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Principal Engineer - Intel Platform & System Engineering
>
>
>
>

Received on 2025-07-31 14:54:47