[compiler-rt] 21d7287 - Revert "[sanitizer] Do not mmap FlagParser::flags_"
Leonard Chan via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 29 13:01:29 PDT 2023
Author: Leonard Chan
Date: 2023-08-29T20:00:24Z
New Revision: 21d72872691fc25244841319c21dfe1236c88636
URL: https://github.com/llvm/llvm-project/commit/21d72872691fc25244841319c21dfe1236c88636
DIFF: https://github.com/llvm/llvm-project/commit/21d72872691fc25244841319c21dfe1236c88636.diff
LOG: Revert "[sanitizer] Do not mmap FlagParser::flags_"
Reverting since this caused Linux/odd_stack_size.cpp to fail on a bunch
of builders.
This reverts commit 34e2f4f2e28a464b127d878979efbc87bc148db5.
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.cpp
compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.h
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.cpp
index 83e080c3149c14..ca37df348580ae 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.cpp
@@ -182,6 +182,9 @@ void FlagParser::RegisterHandler(const char *name, FlagHandlerBase *handler,
++n_flags_;
}
-FlagParser::FlagParser() : n_flags_(0), buf_(nullptr), pos_(0) {}
+FlagParser::FlagParser() : n_flags_(0), buf_(nullptr), pos_(0) {
+ flags_ =
+ (Flag *)GetGlobalLowLevelAllocator().Allocate(sizeof(Flag) * kMaxFlags);
+}
} // namespace __sanitizer
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.h b/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.h
index 9b8c106ec07205..dccdee4da2bd02 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.h
@@ -163,7 +163,7 @@ class FlagParser {
const char *name;
const char *desc;
FlagHandlerBase *handler;
- } flags_[kMaxFlags];
+ } *flags_;
int n_flags_;
const char *buf_;
More information about the llvm-commits
mailing list