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

Side by Side Diff: third_party/WebKit/Source/wtf/allocator/Partitions.h

Issue 2585673002: Replace ASSERT, ENABLE(ASSERT), and ASSERT_NOT_REACHED in wtf (Closed)
Patch Set: Fix an Asan issue with LinkedHashSetNodeBase::unlink Created 4 years 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
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 public: 44 public:
45 typedef void (*ReportPartitionAllocSizeFunction)(size_t); 45 typedef void (*ReportPartitionAllocSizeFunction)(size_t);
46 46
47 // Name of allocator used by tracing for marking sub-allocations while take 47 // Name of allocator used by tracing for marking sub-allocations while take
48 // memory snapshots. 48 // memory snapshots.
49 static const char* const kAllocatedObjectPoolName; 49 static const char* const kAllocatedObjectPoolName;
50 50
51 static void initialize(ReportPartitionAllocSizeFunction); 51 static void initialize(ReportPartitionAllocSizeFunction);
52 static void shutdown(); 52 static void shutdown();
53 ALWAYS_INLINE static base::PartitionRootGeneric* bufferPartition() { 53 ALWAYS_INLINE static base::PartitionRootGeneric* bufferPartition() {
54 ASSERT(s_initialized); 54 DCHECK(s_initialized);
55 return m_bufferAllocator.root(); 55 return m_bufferAllocator.root();
56 } 56 }
57 57
58 ALWAYS_INLINE static base::PartitionRootGeneric* fastMallocPartition() { 58 ALWAYS_INLINE static base::PartitionRootGeneric* fastMallocPartition() {
59 ASSERT(s_initialized); 59 DCHECK(s_initialized);
60 return m_fastMallocAllocator.root(); 60 return m_fastMallocAllocator.root();
61 } 61 }
62 62
63 ALWAYS_INLINE static base::PartitionRoot* nodePartition() { 63 ALWAYS_INLINE static base::PartitionRoot* nodePartition() {
64 ASSERT_NOT_REACHED(); 64 NOTREACHED();
65 return nullptr; 65 return nullptr;
66 } 66 }
67 ALWAYS_INLINE static base::PartitionRoot* layoutPartition() { 67 ALWAYS_INLINE static base::PartitionRoot* layoutPartition() {
68 ASSERT(s_initialized); 68 DCHECK(s_initialized);
69 return m_layoutAllocator.root(); 69 return m_layoutAllocator.root();
70 } 70 }
71 71
72 static size_t currentDOMMemoryUsage() { 72 static size_t currentDOMMemoryUsage() {
73 ASSERT(s_initialized); 73 NOTREACHED();
74 ASSERT_NOT_REACHED();
75 return 0; 74 return 0;
76 } 75 }
77 76
78 static size_t totalSizeOfCommittedPages() { 77 static size_t totalSizeOfCommittedPages() {
79 size_t totalSize = 0; 78 size_t totalSize = 0;
80 totalSize += m_fastMallocAllocator.root()->totalSizeOfCommittedPages; 79 totalSize += m_fastMallocAllocator.root()->totalSizeOfCommittedPages;
81 totalSize += m_bufferAllocator.root()->totalSizeOfCommittedPages; 80 totalSize += m_bufferAllocator.root()->totalSizeOfCommittedPages;
82 totalSize += m_layoutAllocator.root()->totalSizeOfCommittedPages; 81 totalSize += m_layoutAllocator.root()->totalSizeOfCommittedPages;
83 return totalSize; 82 return totalSize;
84 } 83 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 using base::PageAccessible; 164 using base::PageAccessible;
166 using base::PageInaccessible; 165 using base::PageInaccessible;
167 using base::PartitionStatsDumper; 166 using base::PartitionStatsDumper;
168 using base::PartitionMemoryStats; 167 using base::PartitionMemoryStats;
169 using base::PartitionBucketMemoryStats; 168 using base::PartitionBucketMemoryStats;
170 using base::PartitionAllocHooks; 169 using base::PartitionAllocHooks;
171 170
172 } // namespace WTF 171 } // namespace WTF
173 172
174 #endif // Partitions_h 173 #endif // Partitions_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/allocator/PartitionAllocator.h ('k') | third_party/WebKit/Source/wtf/allocator/Partitions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698