Destroying structs (literally)
Orvid King via Digitalmars-d
digitalmars-d at puremagic.com
Thu Aug 28 19:35:04 PDT 2014
On 8/28/2014 9:21 PM, Andrei Alexandrescu wrote:
> Dear community, are you ready for this?
>
> https://issues.dlang.org/show_bug.cgi?id=2834
> https://github.com/D-Programming-Language/druntime/pull/864
>
> We must do it, and the way I see it the earlier the better. Shall we do
> it in 2.067?
>
> This is a significant change of behavior. Should we provide a temporary
> flag or attribute to disable it?
>
>
> Thanks,
>
> Andrei
There should be no breaking behavior, provided the code was previously
calling destroy, and not simply manually calling the destructor directly
for a heap allocated struct, as I've had to make sure that it's not
called more than once, otherwise the existing unittests wouldn't pass.
The only potentially breaking change introduced in this, which was
previously present in one of the struct destructor tests, is that
allocating in the heap allocated struct's destructor isn't allowed.
More information about the Digitalmars-d
mailing list