Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
|
haraken
2016/04/13 02:32:53
I'd move this file to wtf/allocator/.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WTF_Allocator_h | 5 #ifndef WTF_Allocator_h |
| 6 #define WTF_Allocator_h | 6 #define WTF_Allocator_h |
| 7 | 7 |
| 8 #include "wtf/Assertions.h" | 8 #include "wtf/Assertions.h" |
| 9 #include "wtf/Partitions.h" | |
| 10 #include "wtf/StdLibExtras.h" | 9 #include "wtf/StdLibExtras.h" |
| 10 #include "wtf/allocator/Partitions.h" | |
| 11 | 11 |
| 12 namespace WTF { | 12 namespace WTF { |
| 13 | 13 |
| 14 // Classes that contain references to garbage-collected objects but aren't | 14 // Classes that contain references to garbage-collected objects but aren't |
| 15 // themselves garbaged allocated, have some extra macros available which | 15 // themselves garbaged allocated, have some extra macros available which |
| 16 // allows their use to be restricted to cases where the garbage collector | 16 // allows their use to be restricted to cases where the garbage collector |
| 17 // is able to discover their references. These macros will be useful for | 17 // is able to discover their references. These macros will be useful for |
| 18 // non-garbage-collected objects to avoid unintended allocations. | 18 // non-garbage-collected objects to avoid unintended allocations. |
| 19 // | 19 // |
| 20 // STACK_ALLOCATED(): Use if the object is only stack allocated. | 20 // STACK_ALLOCATED(): Use if the object is only stack allocated. |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 // to avoid bloating the binary with type name strings. The |WITH_TYPE_NAME| | 135 // to avoid bloating the binary with type name strings. The |WITH_TYPE_NAME| |
| 136 // variant provides type info unconditionally, so it should be used sparingly. | 136 // variant provides type info unconditionally, so it should be used sparingly. |
| 137 // Furthermore, the |WITH_TYPE_NAME| variant does not work if |type| is a | 137 // Furthermore, the |WITH_TYPE_NAME| variant does not work if |type| is a |
| 138 // template argument; |USING_FAST_MALLOC| does. | 138 // template argument; |USING_FAST_MALLOC| does. |
| 139 #define USING_FAST_MALLOC(type) USING_FAST_MALLOC_INTERNAL(type, WTF_HEAP_PROFIL ER_TYPE_NAME(type)) | 139 #define USING_FAST_MALLOC(type) USING_FAST_MALLOC_INTERNAL(type, WTF_HEAP_PROFIL ER_TYPE_NAME(type)) |
| 140 #define USING_FAST_MALLOC_WITH_TYPE_NAME(type) USING_FAST_MALLOC_INTERNAL(type, #type) | 140 #define USING_FAST_MALLOC_WITH_TYPE_NAME(type) USING_FAST_MALLOC_INTERNAL(type, #type) |
| 141 | 141 |
| 142 } // namespace WTF | 142 } // namespace WTF |
| 143 | 143 |
| 144 #endif /* WTF_Allocator_h */ | 144 #endif /* WTF_Allocator_h */ |
| OLD | NEW |