代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gperftools 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From fe87ffb7ea5a7c6ce4dea45222331716907ddbf4 Mon Sep 17 00:00:00 2001
From: Junhao Li <streaver91@gmail.com>
Date: Sun, 20 May 2018 13:45:32 -0400
Subject: [PATCH] Disable large allocation report by default
Fixes issue #360.
[alkondratenko@gmail.com: adjusted commit message a bit]
[alkondratenko@gmail.com: adjusted configure help message]
Signed-off-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
---
configure.ac | 9 +++++++++
src/tcmalloc.cc | 4 ++++
2 files changed, 13 insertions(+)
diff --git a/configure.ac b/configure.ac
index 497103e..7b5e710 100644
--- a/configure.ac
+++ b/configure.ac
@@ -653,6 +653,15 @@ AC_COMPILE_IFELSE(
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
+# Disable large allocation report by default.
+AC_ARG_ENABLE([large-alloc-report],
+ [AS_HELP_STRING([--enable-large-alloc-report],
+ [report very large allocations to stderr])],
+ [enable_large_alloc_report="$enableval"],
+ [enable_large_alloc_report=no])
+AS_IF([test "x$enable_large_alloc_report" = xyes],
+ [AC_DEFINE([ENABLE_LARGE_ALLOC_REPORT], 1, [report large allocation])])
+
# Write generated configuration file
AC_CONFIG_FILES([Makefile
src/gperftools/tcmalloc.h src/windows/gperftools/tcmalloc.h])
diff --git a/src/tcmalloc.cc b/src/tcmalloc.cc
index 7b18ddb..48d4530 100644
--- a/src/tcmalloc.cc
+++ b/src/tcmalloc.cc
@@ -1272,9 +1272,11 @@ void* handle_oom(malloc_fn retry_fn,
// Copy of FLAGS_tcmalloc_large_alloc_report_threshold with
// automatic increases factored in.
+#ifdef ENABLE_LARGE_ALLOC_REPORT
static int64_t large_alloc_threshold =
(kPageSize > FLAGS_tcmalloc_large_alloc_report_threshold
? kPageSize : FLAGS_tcmalloc_large_alloc_report_threshold);
+#endif
static void ReportLargeAlloc(Length num_pages, void* result) {
StackTrace stack;
@@ -1295,6 +1297,7 @@ static void ReportLargeAlloc(Length num_pages, void* result) {
// Must be called with the page lock held.
inline bool should_report_large(Length num_pages) {
+#ifdef ENABLE_LARGE_ALLOC_REPORT
const int64 threshold = large_alloc_threshold;
if (threshold > 0 && num_pages >= (threshold >> kPageShift)) {
// Increase the threshold by 1/8 every time we generate a report.
@@ -1303,6 +1306,7 @@ inline bool should_report_large(Length num_pages) {
? threshold + threshold/8 : 8ll<<30);
return true;
}
+#endif
return false;
}
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。