-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handles / Opaque linear references #7
Comments
Why are these called "linear references"? Is there a common definition of that term? |
@markshannon, there's some academic background for the term, right? I hope I'm using it correctly :) |
See https://en.wikipedia.org/wiki/Substructural_type_system#Linear_type_systems |
See also capi-workgroup/problems#37 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reference counting (incref/decref) is replaced by what HPy calls handles, and Mark's proposal Opaque, linear references:
PyRef_Close
.PyRef_Dup
. Each must be destroyed (i.e. you can't Close one of them twice).PyRef_Is
, not by a pointer comparisonHPy 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 asPy_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.The text was updated successfully, but these errors were encountered: