bpo-31217: Fix regrtest -R for small integer by vstinner · Pull Request #3258 · python/cpython

Conversation

@vstinner

Workaround a complex bug in regrtest when hunting reference leaks.
Add a maybe_small_long() function to try to get int singletons to
prevent false alarm on memory block leaks.

https://bugs.python.org/issue31217

Workaround a complex bug in regrtest when hunting reference leaks.
Add a maybe_small_long() function to try to get int singletons to
prevent false alarm on memory block leaks.

pitrou

# bpo-31217: On CPython, x_sub() of longobject.c doesn't try to use int
# singletons. Try to get singletons to prevent false alarms on memory block
# leaks.
return int(str(x))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than rely on small int singletons, I think an explicit pool would be less implementation-dependent.

@vstinner

Abandonned in favor of the PR #3260.

Labels