hpy icon indicating copy to clipboard operation
hpy copied to clipboard

Should HPy_Close silently ignore HPy_NULL?

Open steve-s opened this issue 3 years ago • 2 comments

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)

steve-s avatar Feb 23 '22 10:02 steve-s

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.

steve-s avatar Mar 03 '22 09:03 steve-s

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.

hodgestar avatar Mar 04 '22 10:03 hodgestar