My Language Feature Requests

Craig Black craigblack2 at cox.net
Sun Dec 23 06:41:10 PST 2007


> It requires you to store a struct by reference. Thus, performance hit.

No it doesn't.  Structs will be able to be allocated on the stack, without 
any referencing.  As an OPTION, you will be able to store a struct by 
reference.  C++ does this very same thing and it is very efficient.

>> Yes, that will work, but requires a run-time check (and a branch).  The 
>> run-time overhead for what you propose might end up being trivial, but I 
>> think it could be done at compile-time.
>
> I'm not so sure. You'd have to make it undefined behavior to assign a 
> non-fixed address to a fixed pointer. The reverse is fine, of course.
>
> Since class references are pointers, you'd have to have the fixed storage 
> class apply to them as well. Any reference type, really.

Yes and all class fields would be fixed as well, unless the class object was 
instantiated using scope.  This means that when you take the address of 
them, it results in a fixed pointer. 




More information about the Digitalmars-d mailing list