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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 protected: | 102 protected: |
103 friend class WTF::RefCounted<PODArena>; | 103 friend class WTF::RefCounted<PODArena>; |
104 | 104 |
105 PODArena() | 105 PODArena() |
106 : m_allocator(FastMallocAllocator::create()), | 106 : m_allocator(FastMallocAllocator::create()), |
107 m_current(0), | 107 m_current(0), |
108 m_currentChunkSize(DefaultChunkSize) {} | 108 m_currentChunkSize(DefaultChunkSize) {} |
109 | 109 |
110 explicit PODArena(PassRefPtr<Allocator> allocator) | 110 explicit PODArena(PassRefPtr<Allocator> allocator) |
111 : m_allocator(allocator), | 111 : m_allocator(std::move(allocator)), |
112 m_current(0), | 112 m_current(0), |
113 m_currentChunkSize(DefaultChunkSize) {} | 113 m_currentChunkSize(DefaultChunkSize) {} |
114 | 114 |
115 // Returns the alignment requirement for classes and structs on the | 115 // Returns the alignment requirement for classes and structs on the |
116 // current platform. | 116 // current platform. |
117 template <class T> | 117 template <class T> |
118 static size_t minAlignment() { | 118 static size_t minAlignment() { |
119 return WTF_ALIGN_OF(T); | 119 return WTF_ALIGN_OF(T); |
120 } | 120 } |
121 | 121 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 184 |
185 RefPtr<Allocator> m_allocator; | 185 RefPtr<Allocator> m_allocator; |
186 Chunk* m_current; | 186 Chunk* m_current; |
187 size_t m_currentChunkSize; | 187 size_t m_currentChunkSize; |
188 Vector<std::unique_ptr<Chunk>> m_chunks; | 188 Vector<std::unique_ptr<Chunk>> m_chunks; |
189 }; | 189 }; |
190 | 190 |
191 } // namespace blink | 191 } // namespace blink |
192 | 192 |
193 #endif // PODArena_h | 193 #endif // PODArena_h |
OLD | NEW |