Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 30bf31a

Browse files
rmacnak-googleCommit Queue
authored and
Commit Queue
committed
[vm] Avoid allocating via vm_map under TSAN.
TSAN is missing an interceptor for mach_vm_map. TEST=tsan Bug: #61445 Change-Id: Ia3c27a6afd6617843ec9ce336372d2058d498a7a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448256 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
1 parent de0f369 commit 30bf31a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎runtime/vm/virtual_memory_posix.cc‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#endif
3737

3838
#include "platform/assert.h"
39+
#include "platform/thread_sanitizer.h"
3940
#include "platform/utils.h"
4041
#include "vm/heap/pages.h"
4142
#include "vm/isolate.h"
@@ -113,8 +114,10 @@ static void* GenericMapAligned(void* hint,
113114
intptr_t alignment,
114115
intptr_t allocated_size,
115116
int map_flags) {
116-
#if defined(DART_HOST_OS_MACOS)
117+
#if defined(DART_HOST_OS_MACOS) && !defined(USING_THREAD_SANITIZER)
118+
// Allocate aligned memory in one step when possible.
117119
// vm_map doesn't support MAP_JIT.
120+
// tsan is missing an interceptor for mach_vm_map.
118121
if ((map_flags & MAP_JIT) == 0) {
119122
vm_address_t address = 0;
120123
vm_prot_t cur_prot = 0;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /