Message226167
| Author |
scoder |
| Recipients |
mark.dickinson, scoder |
| Date |
2014年08月31日.10:22:00 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1409480520.8.0.291215275837.issue22313@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
"longintrepr.h" is a non-public header file (not included by Python.h) that defines the inner struct layout of PyLong objects. Including it allows for very fast access to "small" integers through ob_digit[0] when -1 <= Py_SIZE(n) <= 1, which is a great feature.
However, the header file depends on PYLONG_BITS_IN_DIGIT being defined and matching exactly the value that was used when building CPython. In the case that --enable-big-digits=X was passed to configure, this value is available from pyconfig.h. Otherwise, it will be determined by pyport.h, where it depends on the current configuration of the C compiler and may in some cases come up with a different definition than it did when building CPython (which then leads to crashes).
I'd like to have the correct build-time value always available in one way or another, e.g. by always storing it in pyconfig.h even when it was not user configured, so that including and using longintrepr.h becomes a safe and simple thing. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2014年08月31日 10:22:00 | scoder | set | recipients:
+ scoder, mark.dickinson |
| 2014年08月31日 10:22:00 | scoder | set | messageid: <1409480520.8.0.291215275837.issue22313@psf.upfronthosting.co.za> |
| 2014年08月31日 10:22:00 | scoder | link | issue22313 messages |
| 2014年08月31日 10:22:00 | scoder | create |
|