| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 unsigned capacity; | 69 unsigned capacity; |
| 70 unsigned size; | 70 unsigned size; |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 template<typename T, unsigned inlineCapacity> | 73 template<typename T, unsigned inlineCapacity> |
| 74 struct SameSizeAsVectorWithInlineCapacity { | 74 struct SameSizeAsVectorWithInlineCapacity { |
| 75 SameSizeAsVectorWithInlineCapacity<T, 0> baseCapacity; | 75 SameSizeAsVectorWithInlineCapacity<T, 0> baseCapacity; |
| 76 AlignedBuffer<inlineCapacity * sizeof(T), WTF_ALIGN_OF(T)> inlineBuffer; | 76 AlignedBuffer<inlineCapacity * sizeof(T), WTF_ALIGN_OF(T)> inlineBuffer; |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 COMPILE_ASSERT(sizeof(OwnPtr<int>) == sizeof(int*), OwnPtr_should_stay_small); | 79 static_assert(sizeof(OwnPtr<int>) == sizeof(int*), "OwnPtr should stay small"); |
| 80 COMPILE_ASSERT(sizeof(PassRefPtr<RefCounted<int> >) == sizeof(int*), PassRefPtr_
should_stay_small); | 80 static_assert(sizeof(PassRefPtr<RefCounted<int> >) == sizeof(int*), "PassRefPtr
should stay small"); |
| 81 COMPILE_ASSERT(sizeof(RefCounted<int>) == sizeof(SameSizeAsRefCounted), RefCount
ed_should_stay_small); | 81 static_assert(sizeof(RefCounted<int>) == sizeof(SameSizeAsRefCounted), "RefCount
ed should stay small"); |
| 82 COMPILE_ASSERT(sizeof(RefPtr<RefCounted<int> >) == sizeof(int*), RefPtr_should_s
tay_small); | 82 static_assert(sizeof(RefPtr<RefCounted<int> >) == sizeof(int*), "RefPtr should s
tay small"); |
| 83 COMPILE_ASSERT(sizeof(String) == sizeof(int*), String_should_stay_small); | 83 static_assert(sizeof(String) == sizeof(int*), "String should stay small"); |
| 84 COMPILE_ASSERT(sizeof(AtomicString) == sizeof(String), AtomicString_should_stay_
small); | 84 static_assert(sizeof(AtomicString) == sizeof(String), "AtomicString should stay
small"); |
| 85 COMPILE_ASSERT(sizeof(Vector<int>) == sizeof(SameSizeAsVectorWithInlineCapacity<
int>), Vector_should_stay_small); | 85 static_assert(sizeof(Vector<int>) == sizeof(SameSizeAsVectorWithInlineCapacity<i
nt>), "Vector should stay small"); |
| 86 COMPILE_ASSERT(sizeof(Vector<int, 1>) == sizeof(SameSizeAsVectorWithInlineCapaci
ty<int, 1>), Vector_should_stay_small); | 86 static_assert(sizeof(Vector<int, 1>) == sizeof(SameSizeAsVectorWithInlineCapacit
y<int, 1>), "Vector should stay small"); |
| 87 COMPILE_ASSERT(sizeof(Vector<int, 2>) == sizeof(SameSizeAsVectorWithInlineCapaci
ty<int, 2>), Vector_should_stay_small); | 87 static_assert(sizeof(Vector<int, 2>) == sizeof(SameSizeAsVectorWithInlineCapacit
y<int, 2>), "Vector should stay small"); |
| 88 COMPILE_ASSERT(sizeof(Vector<int, 3>) == sizeof(SameSizeAsVectorWithInlineCapaci
ty<int, 3>), Vector_should_stay_small); | 88 static_assert(sizeof(Vector<int, 3>) == sizeof(SameSizeAsVectorWithInlineCapacit
y<int, 3>), "Vector should stay small"); |
| 89 } | 89 } |
| OLD | NEW |