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

Side by Side Diff: third_party/WebKit/Source/platform/heap/Heap.h

Issue 1695493002: Have ASan ignore ObjectAliveTrait<>::isHeapObjectAlive() applied to mixins (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 { 60 {
61 static_assert(sizeof(T), "T must be fully defined"); 61 static_assert(sizeof(T), "T must be fully defined");
62 return HeapObjectHeader::fromPayload(object)->isMarked(); 62 return HeapObjectHeader::fromPayload(object)->isMarked();
63 } 63 }
64 }; 64 };
65 65
66 template<typename T> 66 template<typename T>
67 class ObjectAliveTrait<T, true> { 67 class ObjectAliveTrait<T, true> {
68 STATIC_ONLY(ObjectAliveTrait); 68 STATIC_ONLY(ObjectAliveTrait);
69 public: 69 public:
70 NO_LAZY_SWEEP_SANITIZE_ADDRESS
70 static bool isHeapObjectAlive(T* object) 71 static bool isHeapObjectAlive(T* object)
71 { 72 {
72 static_assert(sizeof(T), "T must be fully defined"); 73 static_assert(sizeof(T), "T must be fully defined");
73 return object->isHeapObjectAlive(); 74 return object->isHeapObjectAlive();
74 } 75 }
75 }; 76 };
76 77
77 class PLATFORM_EXPORT Heap { 78 class PLATFORM_EXPORT Heap {
78 STATIC_ONLY(Heap); 79 STATIC_ONLY(Heap);
79 public: 80 public:
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) 497 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object)
497 { 498 {
498 T** cell = reinterpret_cast<T**>(object); 499 T** cell = reinterpret_cast<T**>(object);
499 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) 500 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell))
500 *cell = nullptr; 501 *cell = nullptr;
501 } 502 }
502 503
503 } // namespace blink 504 } // namespace blink
504 505
505 #endif // Heap_h 506 #endif // Heap_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698