hpy
hpy copied to clipboard
Should HPy_Close silently ignore HPy_NULL?
Currently this is the contract in CPython and GraalPython backends. There seems to be no documentation of HPy_Close that would say which is correct. We should make a decision and document it. See also discussion in https://github.com/hpyproject/hpy/pull/281 (last few comments)
We should do some performance measurement for CPython ABI mode performance, where the difference in whether we do extra if (...) may matter. On universal mode HPy_Close is a full function call anyway so we expect the performance difference to be negligible.
Idea from @antocuni: change all DECREF to XDECREF in numpy and run its benchmarks.
Once we make a decision, we should also add the appropriate test so that it's easy for HPy implementations to check that they comply.