reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 1 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 2 | * Copyright 2010 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 8 | #ifndef GrAllocator_DEFINED |
| 9 | #define GrAllocator_DEFINED |
| 10 | |
| 11 | #include "GrConfig.h" |
commit-bot@chromium.org | a0b4028 | 2013-09-18 13:00:55 +0000 | [diff] [blame] | 12 | #include "GrTypes.h" |
bsalomon@google.com | 49313f6 | 2011-09-14 13:54:05 +0000 | [diff] [blame] | 13 | #include "SkTArray.h" |
commit-bot@chromium.org | a0b4028 | 2013-09-18 13:00:55 +0000 | [diff] [blame] | 14 | #include "SkTypes.h" |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 15 | |
commit-bot@chromium.org | e3beb6b | 2014-04-07 19:34:38 +0000 | [diff] [blame] | 16 | class GrAllocator : SkNoncopyable { |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 17 | public: |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 18 | ~GrAllocator() { this->reset(); } |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 19 | |
| 20 | /** |
| 21 | * Create an allocator |
| 22 | * |
| 23 | * @param itemSize the size of each item to allocate |
| 24 | * @param itemsPerBlock the number of items to allocate at once |
| 25 | * @param initialBlock optional memory to use for the first block. |
| 26 | * Must be at least itemSize*itemsPerBlock sized. |
| 27 | * Caller is responsible for freeing this memory. |
| 28 | */ |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 29 | GrAllocator(size_t itemSize, int itemsPerBlock, void* initialBlock) |
| 30 | : fItemSize(itemSize) |
| 31 | , fItemsPerBlock(itemsPerBlock) |
| 32 | , fOwnFirstBlock(NULL == initialBlock) |
| 33 | , fCount(0) |
| 34 | , fInsertionIndexInBlock(0) { |
tfarina@chromium.org | f6de475 | 2013-08-17 00:02:59 +0000 | [diff] [blame] | 35 | SkASSERT(itemsPerBlock > 0); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 36 | fBlockSize = fItemSize * fItemsPerBlock; |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 37 | if (fOwnFirstBlock) { |
| 38 | // This force us to allocate a new block on push_back(). |
| 39 | fInsertionIndexInBlock = fItemsPerBlock; |
| 40 | } else { |
| 41 | fBlocks.push_back() = initialBlock; |
| 42 | fInsertionIndexInBlock = 0; |
| 43 | } |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 44 | } |
| 45 | |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 46 | /** |
| 47 | * Adds an item and returns pointer to it. |
| 48 | * |
| 49 | * @return pointer to the added item. |
| 50 | */ |
| 51 | void* push_back() { |
| 52 | // we always have at least one block |
| 53 | if (fItemsPerBlock == fInsertionIndexInBlock) { |
| 54 | fBlocks.push_back() = sk_malloc_throw(fBlockSize); |
| 55 | fInsertionIndexInBlock = 0; |
| 56 | } |
| 57 | void* ret = (char*)fBlocks.back() + fItemSize * fInsertionIndexInBlock; |
| 58 | ++fCount; |
| 59 | ++fInsertionIndexInBlock; |
| 60 | return ret; |
| 61 | } |
| 62 | |
| 63 | /** |
bsalomon | a1ae66d | 2014-09-05 06:13:43 -0700 | [diff] [blame] | 64 | * Remove the last item, only call if count() != 0 |
| 65 | */ |
| 66 | void pop_back() { |
| 67 | SkASSERT(fCount); |
| 68 | SkASSERT(fInsertionIndexInBlock > 0); |
| 69 | --fInsertionIndexInBlock; |
| 70 | --fCount; |
| 71 | if (0 == fInsertionIndexInBlock) { |
| 72 | // Never delete the first block |
| 73 | if (fBlocks.count() > 1) { |
| 74 | sk_free(fBlocks.back()); |
| 75 | fBlocks.pop_back(); |
| 76 | fInsertionIndexInBlock = fItemsPerBlock; |
| 77 | } |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | /** |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 82 | * Removes all added items. |
| 83 | */ |
| 84 | void reset() { |
| 85 | int firstBlockToFree = fOwnFirstBlock ? 0 : 1; |
| 86 | for (int i = firstBlockToFree; i < fBlocks.count(); ++i) { |
| 87 | sk_free(fBlocks[i]); |
| 88 | } |
| 89 | if (fOwnFirstBlock) { |
| 90 | fBlocks.reset(); |
| 91 | // This force us to allocate a new block on push_back(). |
| 92 | fInsertionIndexInBlock = fItemsPerBlock; |
| 93 | } else { |
| 94 | fBlocks.pop_back_n(fBlocks.count() - 1); |
| 95 | fInsertionIndexInBlock = 0; |
| 96 | } |
| 97 | fCount = 0; |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Returns the item count. |
| 102 | */ |
| 103 | int count() const { |
| 104 | return fCount; |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * Is the count 0? |
| 109 | */ |
| 110 | bool empty() const { return 0 == fCount; } |
| 111 | |
| 112 | /** |
| 113 | * Access last item, only call if count() != 0 |
| 114 | */ |
| 115 | void* back() { |
| 116 | SkASSERT(fCount); |
| 117 | SkASSERT(fInsertionIndexInBlock > 0); |
| 118 | return (char*)(fBlocks.back()) + (fInsertionIndexInBlock - 1) * fItemSize; |
| 119 | } |
| 120 | |
| 121 | /** |
| 122 | * Access last item, only call if count() != 0 |
| 123 | */ |
| 124 | const void* back() const { |
| 125 | SkASSERT(fCount); |
| 126 | SkASSERT(fInsertionIndexInBlock > 0); |
| 127 | return (const char*)(fBlocks.back()) + (fInsertionIndexInBlock - 1) * fItemSize; |
| 128 | } |
| 129 | |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 130 | /** |
| 131 | * Iterates through the allocator. This is faster than using operator[] when walking linearly |
| 132 | * through the allocator. |
| 133 | */ |
| 134 | class Iter { |
| 135 | public: |
| 136 | /** |
| 137 | * Initializes the iterator. next() must be called before get(). |
| 138 | */ |
| 139 | Iter(const GrAllocator* allocator) |
| 140 | : fAllocator(allocator) |
| 141 | , fBlockIndex(-1) |
| 142 | , fIndexInBlock(allocator->fItemsPerBlock - 1) |
| 143 | , fItemIndex(-1) {} |
| 144 | |
| 145 | /** |
| 146 | * Advances the iterator. Iteration is finished when next() returns false. |
| 147 | */ |
| 148 | bool next() { |
| 149 | ++fIndexInBlock; |
| 150 | ++fItemIndex; |
| 151 | if (fIndexInBlock == fAllocator->fItemsPerBlock) { |
| 152 | ++fBlockIndex; |
| 153 | fIndexInBlock = 0; |
| 154 | } |
| 155 | return fItemIndex < fAllocator->fCount; |
| 156 | } |
| 157 | |
| 158 | /** |
| 159 | * Gets the current iterator value. Call next() at least once before calling. Don't call |
| 160 | * after next() returns false. |
| 161 | */ |
bsalomon | e1bc1c6 | 2014-07-02 13:44:57 -0700 | [diff] [blame] | 162 | void* get() const { |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 163 | SkASSERT(fItemIndex >= 0 && fItemIndex < fAllocator->fCount); |
| 164 | return (char*) fAllocator->fBlocks[fBlockIndex] + fIndexInBlock * fAllocator->fItemSize; |
| 165 | } |
| 166 | |
| 167 | private: |
| 168 | const GrAllocator* fAllocator; |
| 169 | int fBlockIndex; |
| 170 | int fIndexInBlock; |
| 171 | int fItemIndex; |
| 172 | }; |
| 173 | |
| 174 | /** |
| 175 | * Access item by index. |
| 176 | */ |
| 177 | void* operator[] (int i) { |
| 178 | SkASSERT(i >= 0 && i < fCount); |
| 179 | return (char*)fBlocks[i / fItemsPerBlock] + |
| 180 | fItemSize * (i % fItemsPerBlock); |
| 181 | } |
| 182 | |
| 183 | /** |
| 184 | * Access item by index. |
| 185 | */ |
| 186 | const void* operator[] (int i) const { |
| 187 | SkASSERT(i >= 0 && i < fCount); |
| 188 | return (const char*)fBlocks[i / fItemsPerBlock] + |
| 189 | fItemSize * (i % fItemsPerBlock); |
| 190 | } |
| 191 | |
| 192 | protected: |
| 193 | /** |
commit-bot@chromium.org | 845da77 | 2013-12-02 22:32:58 +0000 | [diff] [blame] | 194 | * Set first block of memory to write into. Must be called before any other methods. |
| 195 | * This requires that you have passed NULL in the constructor. |
| 196 | * |
| 197 | * @param initialBlock optional memory to use for the first block. |
| 198 | * Must be at least itemSize*itemsPerBlock sized. |
| 199 | * Caller is responsible for freeing this memory. |
| 200 | */ |
| 201 | void setInitialBlock(void* initialBlock) { |
| 202 | SkASSERT(0 == fCount); |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 203 | SkASSERT(0 == fBlocks.count()); |
| 204 | SkASSERT(fItemsPerBlock == fInsertionIndexInBlock); |
commit-bot@chromium.org | 845da77 | 2013-12-02 22:32:58 +0000 | [diff] [blame] | 205 | fOwnFirstBlock = false; |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 206 | fBlocks.push_back() = initialBlock; |
| 207 | fInsertionIndexInBlock = 0; |
commit-bot@chromium.org | 845da77 | 2013-12-02 22:32:58 +0000 | [diff] [blame] | 208 | } |
| 209 | |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 210 | // For access to above function. |
| 211 | template <typename T> friend class GrTAllocator; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 212 | |
| 213 | private: |
bsalomon@google.com | 6a77cc5 | 2011-04-28 17:33:34 +0000 | [diff] [blame] | 214 | static const int NUM_INIT_BLOCK_PTRS = 8; |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 215 | |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 216 | SkSTArray<NUM_INIT_BLOCK_PTRS, void*, true> fBlocks; |
| 217 | size_t fBlockSize; |
| 218 | size_t fItemSize; |
| 219 | int fItemsPerBlock; |
| 220 | bool fOwnFirstBlock; |
| 221 | int fCount; |
| 222 | int fInsertionIndexInBlock; |
bsalomon@google.com | 4b90c62 | 2011-09-28 17:52:15 +0000 | [diff] [blame] | 223 | |
commit-bot@chromium.org | a0b4028 | 2013-09-18 13:00:55 +0000 | [diff] [blame] | 224 | typedef SkNoncopyable INHERITED; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 225 | }; |
| 226 | |
| 227 | template <typename T> |
commit-bot@chromium.org | e3beb6b | 2014-04-07 19:34:38 +0000 | [diff] [blame] | 228 | class GrTAllocator : SkNoncopyable { |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 229 | public: |
bsalomon@google.com | 13788bf | 2011-10-27 17:17:44 +0000 | [diff] [blame] | 230 | virtual ~GrTAllocator() { this->reset(); }; |
bsalomon@google.com | a55847b | 2011-04-20 15:47:04 +0000 | [diff] [blame] | 231 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 232 | /** |
| 233 | * Create an allocator |
| 234 | * |
| 235 | * @param itemsPerBlock the number of items to allocate at once |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 236 | */ |
bsalomon@google.com | 4b90c62 | 2011-09-28 17:52:15 +0000 | [diff] [blame] | 237 | explicit GrTAllocator(int itemsPerBlock) |
| 238 | : fAllocator(sizeof(T), itemsPerBlock, NULL) {} |
bsalomon@google.com | a55847b | 2011-04-20 15:47:04 +0000 | [diff] [blame] | 239 | |
| 240 | /** |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 241 | * Adds an item and returns it. |
| 242 | * |
| 243 | * @return the added item. |
| 244 | */ |
| 245 | T& push_back() { |
| 246 | void* item = fAllocator.push_back(); |
bsalomon | 49f085d | 2014-09-05 13:34:00 -0700 | [diff] [blame] | 247 | SkASSERT(item); |
tomhudson@google.com | c377baf | 2012-07-09 20:17:56 +0000 | [diff] [blame] | 248 | SkNEW_PLACEMENT(item, T); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 249 | return *(T*)item; |
| 250 | } |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 251 | |
| 252 | T& push_back(const T& t) { |
| 253 | void* item = fAllocator.push_back(); |
bsalomon | 49f085d | 2014-09-05 13:34:00 -0700 | [diff] [blame] | 254 | SkASSERT(item); |
tomhudson@google.com | c377baf | 2012-07-09 20:17:56 +0000 | [diff] [blame] | 255 | SkNEW_PLACEMENT_ARGS(item, T, (t)); |
bsalomon@google.com | 4fa6694 | 2011-09-20 19:06:12 +0000 | [diff] [blame] | 256 | return *(T*)item; |
| 257 | } |
| 258 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 259 | /** |
bsalomon | a1ae66d | 2014-09-05 06:13:43 -0700 | [diff] [blame] | 260 | * Remove the last item, only call if count() != 0 |
| 261 | */ |
| 262 | void pop_back() { |
| 263 | this->back().~T(); |
| 264 | fAllocator.pop_back(); |
| 265 | } |
| 266 | |
| 267 | /** |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 268 | * Removes all added items. |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 269 | */ |
| 270 | void reset() { |
bsalomon@google.com | 6a77cc5 | 2011-04-28 17:33:34 +0000 | [diff] [blame] | 271 | int c = fAllocator.count(); |
| 272 | for (int i = 0; i < c; ++i) { |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 273 | ((T*)fAllocator[i])->~T(); |
| 274 | } |
| 275 | fAllocator.reset(); |
| 276 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 277 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 278 | /** |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 279 | * Returns the item count. |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 280 | */ |
bsalomon@google.com | 6a77cc5 | 2011-04-28 17:33:34 +0000 | [diff] [blame] | 281 | int count() const { |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 282 | return fAllocator.count(); |
| 283 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 284 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 285 | /** |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 286 | * Is the count 0? |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 287 | */ |
| 288 | bool empty() const { return fAllocator.empty(); } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 289 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 290 | /** |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 291 | * Access last item, only call if count() != 0 |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 292 | */ |
| 293 | T& back() { |
| 294 | return *(T*)fAllocator.back(); |
| 295 | } |
| 296 | |
| 297 | /** |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 298 | * Access last item, only call if count() != 0 |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 299 | */ |
| 300 | const T& back() const { |
| 301 | return *(const T*)fAllocator.back(); |
| 302 | } |
| 303 | |
| 304 | /** |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 305 | * Iterates through the allocator. This is faster than using operator[] when walking linearly |
| 306 | * through the allocator. |
| 307 | */ |
| 308 | class Iter { |
| 309 | public: |
| 310 | /** |
| 311 | * Initializes the iterator. next() must be called before get() or ops * and ->. |
| 312 | */ |
| 313 | Iter(const GrTAllocator* allocator) : fImpl(&allocator->fAllocator) {} |
| 314 | |
| 315 | /** |
| 316 | * Advances the iterator. Iteration is finished when next() returns false. |
| 317 | */ |
| 318 | bool next() { return fImpl.next(); } |
| 319 | |
| 320 | /** |
| 321 | * Gets the current iterator value. Call next() at least once before calling. Don't call |
| 322 | * after next() returns false. |
| 323 | */ |
bsalomon | e1bc1c6 | 2014-07-02 13:44:57 -0700 | [diff] [blame] | 324 | T* get() const { return (T*) fImpl.get(); } |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 325 | |
| 326 | /** |
| 327 | * Convenience operators. Same rules for calling apply as get(). |
| 328 | */ |
bsalomon | e1bc1c6 | 2014-07-02 13:44:57 -0700 | [diff] [blame] | 329 | T& operator*() const { return *this->get(); } |
| 330 | T* operator->() const { return this->get(); } |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 331 | |
| 332 | private: |
| 333 | GrAllocator::Iter fImpl; |
| 334 | }; |
| 335 | |
| 336 | /** |
| 337 | * Access item by index. |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 338 | */ |
bsalomon@google.com | 6a77cc5 | 2011-04-28 17:33:34 +0000 | [diff] [blame] | 339 | T& operator[] (int i) { |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 340 | return *(T*)(fAllocator[i]); |
| 341 | } |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 342 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 343 | /** |
bsalomon | bce3d6d | 2014-07-02 07:54:42 -0700 | [diff] [blame] | 344 | * Access item by index. |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 345 | */ |
bsalomon@google.com | 6a77cc5 | 2011-04-28 17:33:34 +0000 | [diff] [blame] | 346 | const T& operator[] (int i) const { |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 347 | return *(const T*)(fAllocator[i]); |
bsalomon@google.com | 4b90c62 | 2011-09-28 17:52:15 +0000 | [diff] [blame] | 348 | } |
| 349 | |
| 350 | protected: |
commit-bot@chromium.org | 845da77 | 2013-12-02 22:32:58 +0000 | [diff] [blame] | 351 | /* |
| 352 | * Set first block of memory to write into. Must be called before any other methods. |
| 353 | * |
| 354 | * @param initialBlock optional memory to use for the first block. |
| 355 | * Must be at least size(T)*itemsPerBlock sized. |
| 356 | * Caller is responsible for freeing this memory. |
| 357 | */ |
| 358 | void setInitialBlock(void* initialBlock) { |
| 359 | fAllocator.setInitialBlock(initialBlock); |
bsalomon@google.com | 4b90c62 | 2011-09-28 17:52:15 +0000 | [diff] [blame] | 360 | } |
| 361 | |
| 362 | private: |
| 363 | GrAllocator fAllocator; |
commit-bot@chromium.org | a0b4028 | 2013-09-18 13:00:55 +0000 | [diff] [blame] | 364 | typedef SkNoncopyable INHERITED; |
bsalomon@google.com | 4b90c62 | 2011-09-28 17:52:15 +0000 | [diff] [blame] | 365 | }; |
| 366 | |
| 367 | template <int N, typename T> class GrSTAllocator : public GrTAllocator<T> { |
| 368 | private: |
| 369 | typedef GrTAllocator<T> INHERITED; |
| 370 | |
| 371 | public: |
commit-bot@chromium.org | 845da77 | 2013-12-02 22:32:58 +0000 | [diff] [blame] | 372 | GrSTAllocator() : INHERITED(N) { |
| 373 | this->setInitialBlock(fStorage.get()); |
bsalomon@google.com | 4b90c62 | 2011-09-28 17:52:15 +0000 | [diff] [blame] | 374 | } |
| 375 | |
| 376 | private: |
| 377 | SkAlignedSTStorage<N, T> fStorage; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 378 | }; |
| 379 | |
| 380 | #endif |