OLD | NEW |
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 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1157 // The actual size of a large object is stored in | 1157 // The actual size of a large object is stored in |
1158 // LargeObjectPage::m_payloadSize. | 1158 // LargeObjectPage::m_payloadSize. |
1159 ASSERT(result != largeObjectSizeInHeader); | 1159 ASSERT(result != largeObjectSizeInHeader); |
1160 ASSERT(!pageFromObject(this)->isLargeObjectPage()); | 1160 ASSERT(!pageFromObject(this)->isLargeObjectPage()); |
1161 return result; | 1161 return result; |
1162 } | 1162 } |
1163 | 1163 |
1164 NO_SANITIZE_ADDRESS inline | 1164 NO_SANITIZE_ADDRESS inline |
1165 void HeapObjectHeader::checkHeader() const | 1165 void HeapObjectHeader::checkHeader() const |
1166 { | 1166 { |
1167 ASSERT(pageFromObject(this)->orphaned() || m_magic == magic); | 1167 ASSERT(!pageFromObject(this)->orphaned()); |
| 1168 ASSERT(m_magic == magic); |
1168 } | 1169 } |
1169 | 1170 |
1170 inline Address HeapObjectHeader::payload() | 1171 inline Address HeapObjectHeader::payload() |
1171 { | 1172 { |
1172 return reinterpret_cast<Address>(this) + sizeof(HeapObjectHeader); | 1173 return reinterpret_cast<Address>(this) + sizeof(HeapObjectHeader); |
1173 } | 1174 } |
1174 | 1175 |
1175 inline Address HeapObjectHeader::payloadEnd() | 1176 inline Address HeapObjectHeader::payloadEnd() |
1176 { | 1177 { |
1177 return reinterpret_cast<Address>(this) + size(); | 1178 return reinterpret_cast<Address>(this) + size(); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1293 size_t copySize = previousHeader->payloadSize(); | 1294 size_t copySize = previousHeader->payloadSize(); |
1294 if (copySize > size) | 1295 if (copySize > size) |
1295 copySize = size; | 1296 copySize = size; |
1296 memcpy(address, previous, copySize); | 1297 memcpy(address, previous, copySize); |
1297 return address; | 1298 return address; |
1298 } | 1299 } |
1299 | 1300 |
1300 } // namespace blink | 1301 } // namespace blink |
1301 | 1302 |
1302 #endif // Heap_h | 1303 #endif // Heap_h |
OLD | NEW |