-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Pypy refcheck #16193
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
Pypy refcheck #16193
Conversation
Codecov Report
@@ Coverage Diff @@
## master #16193 +/- ##
==========================================
+ Coverage 90.86% 90.86% +<.01%
==========================================
Files 162 162
Lines 50862 50862
==========================================
+ Hits 46215 46216 +1
+ Misses 4647 4646 -1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #16193 +/- ##
=======================================
Coverage 90.86% 90.86%
=======================================
Files 162 162
Lines 50862 50862
=======================================
Hits 46215 46215
Misses 4647 4647
Continue to review full report at Codecov.
|
Fix formatting for linter |
this seems like a giant change. why not just pass refcheck for object arrays only? |
sorry for the commit bomb, but the The problem with the 'dangerous' option is that it will reallocate the memory of an object held by the user, which could cause inconsistent state in that object, but if that is what you recommend I will submit another pull request along those lines |
At least in the current implementation, I think forcing |
A bit more invasive, but we could also remove the ndarray object entirely from these classes until
|
I added a test in commit 9aaf521 to show how refcheck semantics leak to app-level, if the user takes a reference to |
Vector isn't part of the public api, but I do see your point, thanks for the example. Maybe instead enforce that
|
superseded by #16224 |
np.resize(a, refcheck=True)
relies on refcount semantics to check that no other object holds a reference toa
. Since PyPy only partially mocks refcount semantics, the check is unreliable on PyPy. Unfortunatelya
(or ratheruniques
in this case) is allocated all the way out at user space, so it might be problematic to always userefcheck=False
. Instead I percolatedrefcheck
as a kwarg with default valueTrue
for safety out to the point at whichuniques
is allocated. See also issue #15854.With this change, on PyPy, failing tests that use hashtables now pass