C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Make all data pointers intercompatible

From: Bo Persson <bo_at_[hidden]>
Date: Tue, 28 Jan 2025 16:44:15 +0100
On 2025-01-28 at 15:08, organicoman via Std-Proposals wrote:
> >Here's what I want:
>
> >Point 1) void* and char* are exactly the >same.
>
> At hardware level they are already the same, a different pointer size
> is just a compiler concept, backed up by some bookkeeping.
> void* has always the size of the CPU register, for efficiency,
> configuring it to a smaller size is a compiler concept, that is, instead
> of using the natural architecture instruction, the compiler issues a
> smaller register instruction.
> Expl: instead of
> mov rax, [valueOf ptr] => mov eax, [valueOf ptr]
> ^^^ in 64bit Arch use a ^^^ 32bit void*
>

Are we assuming x86 and Linux/Windows only?

We have seen architectures with separate address registers, not of the
same size as integer and floating-point registers.

Received on 2025-01-28 15:44:19