Core and Builtins
-----------------
+- The internal table, _PyLong_DigitValue, is now an array of unsigned chars
+ instead of ints (reducing its size from 4 to 8 times thereby reducing
+ Python's overall memory).
+
- Issue #1180193: When importing a module from a .pyc (or .pyo) file with
an existing .py counterpart, override the co_filename attributes of all
code objects if the original filename is obsolete (which can happen if the
* Note that when converting a base B string, a char c is a legitimate
* base B digit iff _PyLong_DigitValue[Py_CHARPyLong_MASK(c)] < B.
*/
-int _PyLong_DigitValue[256] = {
+unsigned char _PyLong_DigitValue[256] = {
37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
bits_in_accum = 0;
pdigit = z->ob_digit;
while (--p >= start) {
- int k = _PyLong_DigitValue[Py_CHARMASK(*p)];
+ int k = (int)_PyLong_DigitValue[Py_CHARMASK(*p)];
assert(k >= 0 && k < base);
accum |= (twodigits)(k << bits_in_accum);
bits_in_accum += bits_per_char;
c = (digit)_PyLong_DigitValue[Py_CHARMASK(*str++)];
for (i = 1; i < convwidth && str != scan; ++i, ++str) {
c = (twodigits)(c * base +
- _PyLong_DigitValue[Py_CHARMASK(*str)]);
+ (int)_PyLong_DigitValue[Py_CHARMASK(*str)]);
assert(c < PyLong_BASE);
}