Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2345)

Unified Diff: Source/platform/heap/Heap.h

Issue 363173002: Don't zero out memory added to a free list if ASan is enabled (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Heap.h
diff --git a/Source/platform/heap/Heap.h b/Source/platform/heap/Heap.h
index 218e686b3103b514ba8a2f7faf966fbb80989a3a..81bf4ad0cf68eb27e6c72f982c2e110a0707790b 100644
--- a/Source/platform/heap/Heap.h
+++ b/Source/platform/heap/Heap.h
@@ -398,9 +398,9 @@ public:
: HeapObjectHeader(freeListEncodedSize(size))
, m_next(0)
{
-#if !defined(NDEBUG) && !ASAN
+#if !defined(NDEBUG) && !defined(ADDRESS_SANITIZER)
// Zap free area with asterisks, aka 0x2a2a2a2a.
- // For ASAN don't zap since we keep accounting in the freelist entry.
+ // For ASan don't zap since we keep accounting in the freelist entry.
for (size_t i = sizeof(*this); i < size; i++)
reinterpret_cast<Address>(this)[i] = freelistZapValue;
ASSERT(size >= objectHeaderSize);
@@ -1373,7 +1373,7 @@ Address ThreadHeap<Header>::allocate(size_t size, const GCInfo* gcInfo)
ASSERT(!(reinterpret_cast<uintptr_t>(result) & allocationMask));
// Unpoison the memory used for the object (payload).
ASAN_UNPOISON_MEMORY_REGION(result, payloadSize);
-#if !defined(NDEBUG) || defined(LEAK_SANITIZER)
+#if !defined(NDEBUG) || defined(LEAK_SANITIZER) || defined(ADDRESS_SANITIZER)
memset(result, 0, payloadSize);
#endif
ASSERT(heapPageFromAddress(headerAddress + allocationSize - 1));
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698