collectNoStack should be axed
Chloé
chloekek at use.startmail.com
Mon Apr 22 14:05:50 UTC 2024
On 4/21/24 21:57, Daniel N wrote:
> On Sunday, 21 April 2024 at 19:28:11 UTC, Steven Schveighoffer wrote:
>
> Why do we even support destructors for GC allocated objects? You can't
> depend on it closing file-descriptors or other resources.
>
>
>
Closing non-memory resources is not the only use case for destructors on
GC-allocated objects. Another use case is freeing non-GC-allocated
memory that the object encapsulates. Non-deterministic destruction is
perfectly fine for such a use case. An example of this in Phobos is
std.zlib.Compress.
More information about the Digitalmars-d
mailing list