| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 }; | 346 }; |
| 347 | 347 |
| 348 template <typename T, typename U> | 348 template <typename T, typename U> |
| 349 struct NeedsTracing<std::pair<T, U>> { | 349 struct NeedsTracing<std::pair<T, U>> { |
| 350 static const bool value = NeedsTracing<T>::value || NeedsTracing<U>::value |
| IsWeak<T>::value || IsWeak<U>::value; | 350 static const bool value = NeedsTracing<T>::value || NeedsTracing<U>::value |
| IsWeak<T>::value || IsWeak<U>::value; |
| 351 }; | 351 }; |
| 352 | 352 |
| 353 // This is used to check that DISALLOW_NEW_EXCEPT_PLACEMENT_NEW objects are not | 353 // This is used to check that DISALLOW_NEW_EXCEPT_PLACEMENT_NEW objects are not |
| 354 // stored in off-heap Vectors, HashTables etc. | 354 // stored in off-heap Vectors, HashTables etc. |
| 355 template <typename T> | 355 template <typename T> |
| 356 struct IsAllowOnlyInlineAllocation { | 356 struct AllowsOnlyPlacementNew { |
| 357 private: | 357 private: |
| 358 using YesType = char; | 358 using YesType = char; |
| 359 struct NoType { | 359 struct NoType { |
| 360 char padding[8]; | 360 char padding[8]; |
| 361 }; | 361 }; |
| 362 | 362 |
| 363 template <typename U> static YesType checkMarker(typename U::IsAllowOnlyInli
neAllocation*); | 363 template <typename U> static YesType checkMarker(typename U::IsAllowOnlyPlac
ementNew*); |
| 364 template <typename U> static NoType checkMarker(...); | 364 template <typename U> static NoType checkMarker(...); |
| 365 public: | 365 public: |
| 366 static const bool value = sizeof(checkMarker<T>(nullptr)) == sizeof(YesType)
; | 366 static const bool value = sizeof(checkMarker<T>(nullptr)) == sizeof(YesType)
; |
| 367 }; | 367 }; |
| 368 | 368 |
| 369 template<typename T> | 369 template<typename T> |
| 370 class IsGarbageCollectedType { | 370 class IsGarbageCollectedType { |
| 371 typedef char YesType; | 371 typedef char YesType; |
| 372 typedef struct NoType { | 372 typedef struct NoType { |
| 373 char padding[8]; | 373 char padding[8]; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 391 }; | 391 }; |
| 392 template<typename T> | 392 template<typename T> |
| 393 class IsPointerToGarbageCollectedType<RawPtr<T>> { | 393 class IsPointerToGarbageCollectedType<RawPtr<T>> { |
| 394 public: | 394 public: |
| 395 static const bool value = IsGarbageCollectedType<T>::value; | 395 static const bool value = IsGarbageCollectedType<T>::value; |
| 396 }; | 396 }; |
| 397 | 397 |
| 398 } // namespace WTF | 398 } // namespace WTF |
| 399 | 399 |
| 400 #endif // TypeTraits_h | 400 #endif // TypeTraits_h |
| OLD | NEW |