Does associative array change the location of values?

H. S. Teoh hsteoh at quickfur.ath.cx
Sun Oct 31 16:49:36 UTC 2021


On Sat, Oct 30, 2021 at 07:56:35PM -0700, Ali Çehreli via Digitalmars-d-learn wrote:
> On 10/30/21 3:47 PM, Elronnd wrote:
> 
> > If the GC were moving, it would also have to move the pointers you
> > took to AA elements.
> 
> I doubt D's GC can ever change pointer values because the values may
> be hiding inside e.g. ulong variables. And we would definitely not
> want the GC to change ulong values just because it thought they were
> familiar pointer values in disguise. :)
[...]

The current spec explicitly states that masking pointers this way is UB.


T

-- 
Без труда не выловишь и рыбку из пруда. 


More information about the Digitalmars-d-learn mailing list