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

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

Issue 1159713002: Oilpan: Add a checkHeader ASSERT to HeapObjectHeader::fromPayload (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 | no next file » | 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 239139434f5a54ca4023c309674c5c0dd6bf2e3b..1f1101d6dbdb6277daa1302ad5a0428e39a6d91c 100644
--- a/Source/platform/heap/Heap.h
+++ b/Source/platform/heap/Heap.h
@@ -243,13 +243,6 @@ private:
#endif
};
-inline HeapObjectHeader* HeapObjectHeader::fromPayload(const void* payload)
-{
- Address addr = reinterpret_cast<Address>(const_cast<void*>(payload));
- HeapObjectHeader* header = reinterpret_cast<HeapObjectHeader*>(addr - sizeof(HeapObjectHeader));
- return header;
-}
-
class FreeListEntry final : public HeapObjectHeader {
public:
NO_SANITIZE_ADDRESS
@@ -1189,6 +1182,14 @@ size_t HeapObjectHeader::payloadSize()
return size - sizeof(HeapObjectHeader);
}
+inline HeapObjectHeader* HeapObjectHeader::fromPayload(const void* payload)
+{
+ Address addr = reinterpret_cast<Address>(const_cast<void*>(payload));
+ HeapObjectHeader* header = reinterpret_cast<HeapObjectHeader*>(addr - sizeof(HeapObjectHeader));
+ header->checkHeader();
+ return header;
+}
+
NO_SANITIZE_ADDRESS inline
bool HeapObjectHeader::isMarked() const
{
« 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