-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Reference counting (incref/decref) is replaced by what HPy calls handles, and Mark's proposal Opaque, linear references:
- Each handle has exctly one owner.
- Handles are destroyed by
PyRef_Close. - Handles are duplicated using
PyRef_Dup. Each must be destroyed (i.e. you can't Close one of them twice). - There can be multiple handles for a single object.
- Object identity is compared using
PyRef_Is, not by a pointer comparison
HPy shows that this enables a moving GC.
It does need all users to update all their code, so CPython probably can't ever require this. But we could provide PyRef_Dup/PyRef_Close/PyRef_Is (implemented as Py_INCREF/Py_DECREF/Py_Is) to allow users to signal that they're using handle semantics, and are (theoretically) compatible with implementations that use a moving GC.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels