This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sir-sigurd
Recipients sir-sigurd, vstinner
Date 2019-09-19.15:27:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> If you care of _PyLong_Copy() performance, you should somehow manually inline _PyLong_New() inside _PyLong_Copy().

It doesn't solve this:

> We could add a function that bypass that check, but in LTO build PyObject_MALLOC() is inlined into _PyLong_New() and it also checks the size. Adding Py_ASSUME((size_t)size <= MAX_LONG_DIGITS) allows to bypass both checks.

Here's example:

I attach some disassembly from this example compiled with LTO, to demonstrate how the proposed macro affects generated code.
Date User Action Args
2019-09-19 15:27:43sir-sigurdsetrecipients: + sir-sigurd, vstinner
2019-09-19 15:27:43sir-sigurdsetmessageid: <>
2019-09-19 15:27:43sir-sigurdlinkissue38147 messages
2019-09-19 15:27:43sir-sigurdcreate