summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2021-10-21 13:12:20 (GMT)
committerGitHub <noreply@github.com>2021-10-21 13:12:20 (GMT)
commit9942f42a93ccda047fd3558c47b822e99afe10c0 (patch)
tree5a28ecf799a90b9225530c12acd7c38c1935f156 /configure
parent5a14f71fe869d4a62dcdeb9a8fbbb5884c75060c (diff)
downloadcpython-9942f42a93ccda047fd3558c47b822e99afe10c0.zip
cpython-9942f42a93ccda047fd3558c47b822e99afe10c0.tar.gz
cpython-9942f42a93ccda047fd3558c47b822e99afe10c0.tar.bz2
bpo-45522: Allow to disable freelists on build time (GH-29056)
Freelists for object structs can now be disabled. A new ``configure`` option ``--without-freelists`` can be used to disable all freelists except empty tuple singleton. Internal Py*_MAXFREELIST macros can now be defined as 0 without causing compiler warnings and segfaults. Signed-off-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure26
1 files changed, 26 insertions, 0 deletions
diff --git a/configure b/configure
index ec7c72c..198b070 100755
--- a/configure
+++ b/configure
@@ -846,6 +846,7 @@ with_dbmliborder
enable_ipv6
with_doc_strings
with_pymalloc
+with_freelists
with_c_locale_coercion
with_valgrind
with_dtrace
@@ -1588,6 +1589,7 @@ Optional Packages:
names `ndbm', `gdbm' and `bdb'.
--with-doc-strings enable documentation strings (default is yes)
--with-pymalloc enable specialized mallocs (default is yes)
+ --with-freelists enable object freelists (default is yes)
--with-c-locale-coercion
enable C locale coercion to a UTF-8 based locale
(default is yes)
@@ -11728,6 +11730,30 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pymalloc" >&5
$as_echo "$with_pymalloc" >&6; }
+# Check whether objects such as float, tuple and dict are using
+# freelists to optimization memory allocation.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-freelists" >&5
+$as_echo_n "checking for --with-freelists... " >&6; }
+
+# Check whether --with-freelists was given.
+if test "${with_freelists+set}" = set; then :
+ withval=$with_freelists;
+fi
+
+
+if test -z "$with_freelists"
+then
+ with_freelists="yes"
+fi
+if test "$with_freelists" != "no"
+then
+
+$as_echo "#define WITH_FREELISTS 1" >>confdefs.h
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_freelists" >&5
+$as_echo "$with_freelists" >&6; }
+
# Check for --with-c-locale-coercion
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-c-locale-coercion" >&5
$as_echo_n "checking for --with-c-locale-coercion... " >&6; }