mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Wire up the standalone leak sanitizer. (#320)
By default, address sanitizer enabled builds can detect leaks if the `ASAN_OPTIONS=detect_leaks=1` environment option is specified. If only leaks need to detected, this standalong option may be used.
This commit is contained in:
parent
a2a0a4e8ca
commit
41b6918f1c
@ -43,17 +43,11 @@ config("feature_flags") {
|
|||||||
if (use_nss_certs) {
|
if (use_nss_certs) {
|
||||||
defines += [ "USE_NSS_CERTS=1" ]
|
defines += [ "USE_NSS_CERTS=1" ]
|
||||||
}
|
}
|
||||||
if (use_allocator != "tcmalloc") {
|
|
||||||
defines += [ "NO_TCMALLOC" ]
|
|
||||||
}
|
|
||||||
if (is_asan) {
|
if (is_asan) {
|
||||||
defines += [ "ADDRESS_SANITIZER" ]
|
defines += [ "ADDRESS_SANITIZER" ]
|
||||||
}
|
}
|
||||||
if (is_lsan) {
|
if (is_lsan) {
|
||||||
defines += [
|
defines += [ "LEAK_SANITIZER" ]
|
||||||
"LEAK_SANITIZER",
|
|
||||||
"WTF_USE_LEAK_SANITIZER=1",
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
if (is_tsan) {
|
if (is_tsan) {
|
||||||
defines += [
|
defines += [
|
||||||
|
@ -2,15 +2,7 @@
|
|||||||
# Use of this source code is governed by a BSD-style license that can be
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
# found in the LICENSE file.
|
# found in the LICENSE file.
|
||||||
|
|
||||||
# TODO(GYP): Make tcmalloc work on win.
|
|
||||||
if (is_android || current_cpu == "mipsel" || is_mac || is_ios || is_asan ||
|
|
||||||
is_lsan || is_tsan || is_msan || is_win) {
|
|
||||||
_default_allocator = "none"
|
|
||||||
} else {
|
|
||||||
_default_allocator = "tcmalloc"
|
|
||||||
}
|
|
||||||
|
|
||||||
declare_args() {
|
declare_args() {
|
||||||
# Memory allocator to use. Set to "none" to use default allocator.
|
# Memory allocator to use. Set to "none" to use default allocator.
|
||||||
use_allocator = _default_allocator
|
use_allocator = "none"
|
||||||
}
|
}
|
||||||
|
@ -120,6 +120,7 @@ config("compiler") {
|
|||||||
}
|
}
|
||||||
if (is_lsan) {
|
if (is_lsan) {
|
||||||
cflags += [ "-fsanitize=leak" ]
|
cflags += [ "-fsanitize=leak" ]
|
||||||
|
ldflags += [ "-fsanitize=leak" ]
|
||||||
}
|
}
|
||||||
if (is_tsan) {
|
if (is_tsan) {
|
||||||
cflags += [ "-fsanitize=thread" ]
|
cflags += [ "-fsanitize=thread" ]
|
||||||
|
Loading…
Reference in New Issue
Block a user