D design problem on platforms with <32 bit pointer width

Dukc ajieskola at gmail.com
Tue Aug 22 08:22:04 UTC 2023


On Monday, 21 August 2023 at 03:48:04 UTC, Richard (Rikki) Andrew 
Cattermole wrote:
> On 21/08/2023 7:13 AM, Walter Bright wrote:
>> Some things are impractical for D:
>> 
>>  1. mixed near/far pointers
>
> I've been thinking about this and I don't think that this is 
> true.
>
> Add two new core.attributes udas.
>
> ``enum near;`` and ``enum far;``
>
> If we need segment support ``enum uda(string segment:"FS");`` 
> would suffice.
>
> Require it on all variable declarations, easy! Oh and don't 
> forget to do matching of argument/expression validation to 
> declaration for @safe code.

I don't think we need to discuss near/far pointers here. This is 
about your regular monosize pointers that just happen to be under 
32 bits. You not have the far pointer option at all. What to do 
when the platform has two different pointer widths, be they 16/32 
or 32/64, is a different question.




More information about the Digitalmars-d mailing list