Currently OwnedRef and ScopedRef have similar semantics with small differences. Furtheremore, the naming distinction isn't obvious.
I propose to unify them as a single OwnedRef class with the following characteristics:
-
doesn't take the GIL automatically
-
has a release() method that decrefs the pointer (and sets the internal copy to NULL) before returning it
-
has a detach() method that returns the pointer (and sets the internal copy to NULL) without decrefing it
For the rare situations where an OwnedRef may be destroyed with the GIL released, a OwnedRefNoGIL derived class would also be proposed (the naming scheme follows Cython here).
Opinions / comments?
Reporter: Antoine Pitrou / @pitrou
Assignee: Antoine Pitrou / @pitrou
PRs and other links:
Note: This issue was originally created as ARROW-2052. Please see the migration documentation for further details.
Currently
OwnedRefandScopedRefhave similar semantics with small differences. Furtheremore, the naming distinction isn't obvious.I propose to unify them as a single
OwnedRefclass with the following characteristics:doesn't take the GIL automatically
has a
release()method that decrefs the pointer (and sets the internal copy to NULL) before returning ithas a
detach()method that returns the pointer (and sets the internal copy to NULL) without decrefing itFor the rare situations where an
OwnedRefmay be destroyed with the GIL released, aOwnedRefNoGILderived class would also be proposed (the naming scheme follows Cython here).Opinions / comments?
Reporter: Antoine Pitrou / @pitrou
Assignee: Antoine Pitrou / @pitrou
PRs and other links:
Note: This issue was originally created as ARROW-2052. Please see the migration documentation for further details.