aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/config.h.in
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-04-12 17:56:45 +0100
committerJonathan Wakely <jwakely@redhat.com>2022-04-12 22:38:31 +0100
commit3c742621ed28540cf42d4cfbc2bf03433cd26738 (patch)
treefb0b6e89fda4b8eeffd65d81304b4e118691e188 /libstdc++-v3/config.h.in
parentb2c007b87dcd5db5d59447de2081777aea66f35f (diff)
downloadgcc-3c742621ed28540cf42d4cfbc2bf03433cd26738.zip
gcc-3c742621ed28540cf42d4cfbc2bf03433cd26738.tar.gz
gcc-3c742621ed28540cf42d4cfbc2bf03433cd26738.tar.bz2
libstdc++: Prefer to use mmap instead of malloc in libbacktrace
As reported in PR libbacktrace/105240, libbacktrace leaks memory when using malloc for allocations. I originally thought it would be simpler to just use malloc unconditionally (because it's supported on all targets) but the leaks make that problematic. This adds libbacktrace's detection for mmap to the libstdc++ configury, so that we use mmap.c and mmapio.c when possible. This avoids the leaks seen previously, at least on linux. libstdc++-v3/ChangeLog: * acinclude.m4 (GLIBCXX_ENABLE_BACKTRACE): Check for mmap. * config.h.in: Regenerate. * configure: Regenerate.
Diffstat (limited to 'libstdc++-v3/config.h.in')
-rw-r--r--libstdc++-v3/config.h.in3
1 files changed, 3 insertions, 0 deletions
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index f6212de..f30a8c5 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -420,6 +420,9 @@
/* Define to 1 if you have the <sys/machine.h> header file. */
#undef HAVE_SYS_MACHINE_H
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#undef HAVE_SYS_MMAN_H
+
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H