Skip to content

Warn when trying to isolate reference types in refc #25352

@arnetheduck

Description

@arnetheduck

Nim Version

2.2.4

Description

Calling isolate is meant to isolate all properties of the instance making it safe for moving to another thread - reference types are not safe for such moves since they implicitly reference the thread-local heap - ie they are not isolated in that sense.

This creates problems when refc users accidentally, or through the use of a library, try to isolate instaces of types that somewhere in their graph contain any heap-allocated type.

Notably, isolating non-heap types is safe and should not warn - this way, code that targets both refc and orc can work for non-heap types without further modifications - in refc it is after all common to pass ptr and other non-heap types across boundaries.

Current Output


Expected Output


Known Workarounds

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions