Skip to content

stop using finalizers for resource management? #11207

@JeffBezanson

Description

@JeffBezanson

Finalizers are inefficient and unpredictable. And with the new GC, it might take much longer to get around to freeing an object, therefore tying up its resources longer. Ideally releasing external resources should not be tied to how memory management works.

We are already not far from this with the open(f) do construct. I think that and/or with should be used. Perhaps there could be some other mechanism for registering files to close eventually.

Discussed this with @carnaval .

Metadata

Metadata

Assignees

No one assigned

    Labels

    GCGarbage collectordesignDesign of APIs or of the language itselfspeculativeWhether the change will be implemented is speculative

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions