OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrAllocator_DEFINED | 8 #ifndef GrAllocator_DEFINED |
9 #define GrAllocator_DEFINED | 9 #define GrAllocator_DEFINED |
10 | 10 |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 }; | 382 }; |
383 | 383 |
384 template <typename T> void* operator new(size_t size, GrTAllocator<T>* allocator
) { | 384 template <typename T> void* operator new(size_t size, GrTAllocator<T>* allocator
) { |
385 return allocator->fAllocator.push_back(); | 385 return allocator->fAllocator.push_back(); |
386 } | 386 } |
387 | 387 |
388 // Skia doesn't use C++ exceptions but it may be compiled with them enabled. Hav
ing an op delete | 388 // Skia doesn't use C++ exceptions but it may be compiled with them enabled. Hav
ing an op delete |
389 // to match the op new silences warnings about missing op delete when a construc
tor throws an | 389 // to match the op new silences warnings about missing op delete when a construc
tor throws an |
390 // exception. | 390 // exception. |
391 template <typename T> void operator delete(void*, GrTAllocator<T>*) { | 391 template <typename T> void operator delete(void*, GrTAllocator<T>*) { |
392 SK_CRASH(); | 392 SK_ABORT("Invalid Operation"); |
393 } | 393 } |
394 | 394 |
395 #define GrNEW_APPEND_TO_ALLOCATOR(allocator_ptr, type_name, args) \ | 395 #define GrNEW_APPEND_TO_ALLOCATOR(allocator_ptr, type_name, args) \ |
396 new (allocator_ptr) type_name args | 396 new (allocator_ptr) type_name args |
397 | 397 |
398 #endif | 398 #endif |
OLD | NEW |