Skip to content

*Localize* objects once the bridge of the owning region object reaches RC=0 #51

@xFrednet

Description

@xFrednet

When the bridge object of a region hits a reference count of zero, it is no longer possible to send it anywhere. Implicitly, it's therefore ensured that all objects contained in a that region are bound to the lifetime of any borrows of those objects.

It should be possible to move these objects back into the local region. This would make the system more flexible, by allowing these objects to be put into another region again. It would basically act as a very cheap extract operation.

b = {} # b is a local object

a = Region()
a.b = b # is moved into region a

a = None # a's RC hits zero
# By moving all objects in `a` (namely b in this case) back into
# the local region. We could then send b into another region again

c = Region()
c.b = b # This would become valid with this change

This makes region closer to a box used to send data. A different scope can then decide to unpack the stored data and repackage it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions