Commit 25cb2a15 authored by Omer Katz's avatar Omer Katz Committed by Commit Bot

heap: Fix MARKING_AWARE_ANNOTATE_CHANGE_SIZE macro

Based on binary size, the branch in the macro wasn't optimized away on non-asan
builds. This fix manually removes the branch when it's not needed.

Bug: 1099412
Change-Id: I318f02fc7c254db0dc2b5098109734d170138b5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2276279Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784411}
parent c82468fc
...@@ -79,6 +79,7 @@ class Deque; ...@@ -79,6 +79,7 @@ class Deque;
// capacity as accessible. With concurrent marking enabled, annotating size // capacity as accessible. With concurrent marking enabled, annotating size
// changes could conflict with marking the whole store as accessible, causing // changes could conflict with marking the whole store as accessible, causing
// a race. // a race.
#if defined(ADDRESS_SANITIZER)
#define MARKING_AWARE_ANNOTATE_CHANGE_SIZE(Allocator, buffer, capacity, \ #define MARKING_AWARE_ANNOTATE_CHANGE_SIZE(Allocator, buffer, capacity, \
old_size, new_size) \ old_size, new_size) \
if (Allocator::kIsGarbageCollected && Allocator::IsIncrementalMarking()) { \ if (Allocator::kIsGarbageCollected && Allocator::IsIncrementalMarking()) { \
...@@ -86,6 +87,11 @@ class Deque; ...@@ -86,6 +87,11 @@ class Deque;
} else { \ } else { \
ANNOTATE_CHANGE_SIZE(buffer, capacity, old_size, new_size) \ ANNOTATE_CHANGE_SIZE(buffer, capacity, old_size, new_size) \
} }
#else
#define MARKING_AWARE_ANNOTATE_CHANGE_SIZE(Allocator, buffer, capacity, \
old_size, new_size) \
ANNOTATE_CHANGE_SIZE(buffer, capacity, old_size, new_size)
#endif // defined(ADDRESS_SANITIZER)
template <bool needsDestruction, typename T> template <bool needsDestruction, typename T>
struct VectorDestructor; struct VectorDestructor;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment