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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 protected: | 349 protected: |
350 void operator delete[](void* p) | 350 void operator delete[](void* p) |
351 { | 351 { |
352 ASSERT_NOT_REACHED(); | 352 ASSERT_NOT_REACHED(); |
353 } | 353 } |
354 #else | 354 #else |
355 void operator delete[](void* p); | 355 void operator delete[](void* p); |
356 #endif | 356 #endif |
357 | 357 |
358 public: | 358 public: |
359 using GarbageCollectedBase = T; | 359 using GarbageCollectedType = T; |
360 | 360 |
361 void* operator new(size_t size) | 361 void* operator new(size_t size) |
362 { | 362 { |
363 return allocateObject(size, IsEagerlyFinalizedType<T>::value); | 363 return allocateObject(size, IsEagerlyFinalizedType<T>::value); |
364 } | 364 } |
365 | 365 |
366 static void* allocateObject(size_t size, bool eagerlySweep) | 366 static void* allocateObject(size_t size, bool eagerlySweep) |
367 { | 367 { |
368 return Heap::allocate<T>(size, eagerlySweep); | 368 return Heap::allocate<T>(size, eagerlySweep); |
369 } | 369 } |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) | 508 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) |
509 { | 509 { |
510 T** cell = reinterpret_cast<T**>(object); | 510 T** cell = reinterpret_cast<T**>(object); |
511 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) | 511 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) |
512 *cell = nullptr; | 512 *cell = nullptr; |
513 } | 513 } |
514 | 514 |
515 } // namespace blink | 515 } // namespace blink |
516 | 516 |
517 #endif // Heap_h | 517 #endif // Heap_h |
OLD | NEW |