On Sun, Oct 31, 2021 at 09:54:23AM -0700, Ali Çehreli via Digitalmars-d-learn wrote: > On 10/31/21 9:49 AM, H. S. Teoh wrote: > > > The current spec explicitly states that masking pointers this way is UB. > > Ok. :) What about unions? > > union U { > ulong u; > void* p; > } > > Can the GC deal with that?
https://dlang.org/spec/garbage.html#obj_pinning_and_gc Though I have to say, object pinning does impose restrictions on a moving GC implementation that may negate some of its benefits. T -- Never criticize a man until you've walked a mile in his shoes. Then when you do criticize him, you'll be a mile away and he won't have his shoes.