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 25 matching lines...) Expand all Loading... |
36 #include <wtf/RefCounted.h> | 36 #include <wtf/RefCounted.h> |
37 #include <wtf/RefPtr.h> | 37 #include <wtf/RefPtr.h> |
38 #include <wtf/ThreadRestrictionVerifier.h> | 38 #include <wtf/ThreadRestrictionVerifier.h> |
39 #include <wtf/Vector.h> | 39 #include <wtf/Vector.h> |
40 | 40 |
41 namespace WTF { | 41 namespace WTF { |
42 | 42 |
43 #ifndef NDEBUG | 43 #ifndef NDEBUG |
44 struct SameSizeAsRefCounted { | 44 struct SameSizeAsRefCounted { |
45 int a; | 45 int a; |
46 bool b; | 46 // FIXME(oilpan): Remove the following comment-outs once we replace |
47 bool c; | 47 // all RefCountedHeapAllocated with HeapAllocated. |
48 ThreadRestrictionVerifier d; | 48 // bool b; |
| 49 // bool c; |
| 50 // ThreadRestrictionVerifier d; |
49 // The debug version may get bigger. | 51 // The debug version may get bigger. |
50 }; | 52 }; |
51 #else | 53 #else |
52 struct SameSizeAsRefCounted { | 54 struct SameSizeAsRefCounted { |
53 int a; | 55 int a; |
54 // Don't add anything here because this should stay small. | 56 // Don't add anything here because this should stay small. |
55 }; | 57 }; |
56 #endif | 58 #endif |
57 | 59 |
58 COMPILE_ASSERT(sizeof(OwnPtr<int>) == sizeof(int*), OwnPtr_should_stay_small); | 60 COMPILE_ASSERT(sizeof(OwnPtr<int>) == sizeof(int*), OwnPtr_should_stay_small); |
59 COMPILE_ASSERT(sizeof(PassRefPtr<RefCounted<int> >) == sizeof(int*), PassRefPtr_
should_stay_small); | 61 COMPILE_ASSERT(sizeof(PassRefPtr<RefCounted<int> >) == sizeof(int*), PassRefPtr_
should_stay_small); |
60 COMPILE_ASSERT(sizeof(RefCounted<int>) == sizeof(SameSizeAsRefCounted), RefCount
ed_should_stay_small); | 62 COMPILE_ASSERT(sizeof(RefCounted<int>) == sizeof(SameSizeAsRefCounted), RefCount
ed_should_stay_small); |
61 COMPILE_ASSERT(sizeof(RefCountedCustomAllocated<int>) == sizeof(SameSizeAsRefCou
nted), RefCountedCustomAllocated_should_stay_small); | 63 COMPILE_ASSERT(sizeof(RefCountedCustomAllocated<int>) == sizeof(SameSizeAsRefCou
nted), RefCountedCustomAllocated_should_stay_small); |
62 COMPILE_ASSERT(sizeof(RefPtr<RefCounted<int> >) == sizeof(int*), RefPtr_should_s
tay_small); | 64 COMPILE_ASSERT(sizeof(RefPtr<RefCounted<int> >) == sizeof(int*), RefPtr_should_s
tay_small); |
63 #if !(OS(WINDOWS) && CPU(X86_64)) // Packing trouble on Win64. See crbug.com/23
1671 | 65 #if !(OS(WINDOWS) && CPU(X86_64)) // Packing trouble on Win64. See crbug.com/23
1671 |
64 COMPILE_ASSERT(sizeof(Vector<int>) == sizeof(int*) + 2 * sizeof(int), Vector_sho
uld_stay_small); | 66 COMPILE_ASSERT(sizeof(Vector<int>) == sizeof(int*) + 2 * sizeof(int), Vector_sho
uld_stay_small); |
65 COMPILE_ASSERT(sizeof(Vector<int, 1>) == 2 * sizeof(int*) + 2 * sizeof(int), Vec
tor_should_stay_small); | 67 COMPILE_ASSERT(sizeof(Vector<int, 1>) == 2 * sizeof(int*) + 2 * sizeof(int), Vec
tor_should_stay_small); |
66 #endif | 68 #endif |
67 | 69 |
68 } | 70 } |
OLD | NEW |