D array expansion and non-deterministic re-allocation

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Nov 17 18:47:44 PST 2009


Bartosz Milewski wrote:
> Walter Bright Wrote:
> 
>> BCS wrote:
>>> would you agree that it is not something the programer can predict in 
>>> advance?
>> He can, but it is not reasonable to expect him to. But it's still 
>> deterministic.
> 
> I've been following this discussion about determinism and I think it addresses the problem from the wrong point of view, that of a specific implementation. 
> 
> My concern is the semantics of the language. As it is defined right now, a conforming implementation is free to use a quantum random number generator to decide whether to re-allocate or not. Is it likely? I don't think so; but the non-determinism is part of the semantics of D arrays.

It would not be difficult to specify in the language definition (and 
TDPL) that behavior is deterministic for a given platform. I think this 
has some impact on the freedom of the memory allocator, but probably not 
major.

Andrei



More information about the Digitalmars-d mailing list