May 03, 2015 Re: compile time garbage collection | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ola Fosheim Grøstad | On Sunday, 3 May 2015 at 08:34:09 UTC, Ola Fosheim Grøstad wrote: > On Sunday, 3 May 2015 at 08:22:31 UTC, weaselcat wrote: >> >> there's no guarantee GC allocated memory will _ever_ have their destructor ran, it's part of the spec. > > That would be very unfortunate, they have to either be called eventually or never called. I find no such description in the "spec": > > http://dlang.org/garbage.html > > «5. Freeing all GC allocated memory that has no active pointers to it and do not need destructors to run. > > 6. Queueing all unreachable memory that needs destructors to run. > > 7. Resuming all other threads. > > 8. Running destructors for all queued memory.» http://dlang.org/class.html#destructors |
May 03, 2015 Re: compile time garbage collection | ||||
---|---|---|---|---|
| ||||
Posted in reply to weaselcat | On Sunday, 3 May 2015 at 08:41:04 UTC, weaselcat wrote:
>
> http://dlang.org/class.html#destructors
Oh well, that should be described under GC too then, but it can improve collection speed so I guess it is ok if one requires classes to be marked @nogc if they have destructors.
The inbetween position is just dangerous.
|
Copyright © 1999-2021 by the D Language Foundation