summaryrefslogtreecommitdiffstats
path: root/Include/pyport.h
diff options
context:
space:
mode:
authorMark Dickinson <mdickinson@enthought.com>2022-01-14 18:54:56 (GMT)
committerGitHub <noreply@github.com>2022-01-14 18:54:56 (GMT)
commit025cbe7a9b5d3058ce2eb8015d3650e396004545 (patch)
treedbe02480ec23d31a72088bce7dd641d9bf45160e /Include/pyport.h
parentee1a8b336d30476e9635a6826f61a99fc3604159 (diff)
downloadcpython-025cbe7a9b5d3058ce2eb8015d3650e396004545.zip
cpython-025cbe7a9b5d3058ce2eb8015d3650e396004545.tar.gz
cpython-025cbe7a9b5d3058ce2eb8015d3650e396004545.tar.bz2
bpo-45569: Change PYLONG_BITS_IN_DIGIT default to 30 (GH-30497)
Diffstat (limited to 'Include/pyport.h')
-rw-r--r--Include/pyport.h16
1 files changed, 4 insertions, 12 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index 81b1bde..d27b3dd 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -85,20 +85,12 @@ Used in: Py_SAFE_DOWNCAST
#define PY_INT32_T int32_t
#define PY_INT64_T int64_t
-/* If PYLONG_BITS_IN_DIGIT is not defined then we'll use 30-bit digits if all
- the necessary integer types are available, and we're on a 64-bit platform
- (as determined by SIZEOF_VOID_P); otherwise we use 15-bit digits.
-
- From pyodide: WASM has 32 bit pointers but has native 64 bit arithmetic
- so it is more efficient to use 30 bit digits.
+/* PYLONG_BITS_IN_DIGIT describes the number of bits per "digit" (limb) in the
+ * PyLongObject implementation (longintrepr.h). It's currently either 30 or 15,
+ * defaulting to 30. The 15-bit digit option may be removed in the future.
*/
-
#ifndef PYLONG_BITS_IN_DIGIT
-#if SIZEOF_VOID_P >= 8 || defined(__wasm__)
-# define PYLONG_BITS_IN_DIGIT 30
-#else
-# define PYLONG_BITS_IN_DIGIT 15
-#endif
+#define PYLONG_BITS_IN_DIGIT 30
#endif
/* uintptr_t is the C9X name for an unsigned integral type such that a