Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Side by Side Diff: include/core/SkTArray.h

Issue 1620333002: Revert of Consolidate SK_CRASH and sk_throw into SK_ABORT (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/core/SkPostConfig.h ('k') | include/core/SkTypes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 SkTArray_DEFINED 8 #ifndef SkTArray_DEFINED
9 #define SkTArray_DEFINED 9 #define SkTArray_DEFINED
10 10
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 // SkASSERT(atIndex >= 0 && atIndex <= array->count()); 500 // SkASSERT(atIndex >= 0 && atIndex <= array->count());
501 SkASSERT(atIndex == array->count()); 501 SkASSERT(atIndex == array->count());
502 return array->push_back_raw(1); 502 return array->push_back_raw(1);
503 } 503 }
504 504
505 // Skia doesn't use C++ exceptions but it may be compiled with them enabled. Hav ing an op delete 505 // Skia doesn't use C++ exceptions but it may be compiled with them enabled. Hav ing an op delete
506 // to match the op new silences warnings about missing op delete when a construc tor throws an 506 // to match the op new silences warnings about missing op delete when a construc tor throws an
507 // exception. 507 // exception.
508 template <typename T, bool MEM_COPY> 508 template <typename T, bool MEM_COPY>
509 void operator delete(void*, SkTArray<T, MEM_COPY>* /*array*/, int /*atIndex*/) { 509 void operator delete(void*, SkTArray<T, MEM_COPY>* /*array*/, int /*atIndex*/) {
510 SK_ABORT("Invalid Operation"); 510 SK_CRASH();
511 } 511 }
512 512
513 // Constructs a new object as the last element of an SkTArray. 513 // Constructs a new object as the last element of an SkTArray.
514 #define SkNEW_APPEND_TO_TARRAY(array_ptr, type_name, args) \ 514 #define SkNEW_APPEND_TO_TARRAY(array_ptr, type_name, args) \
515 (new ((array_ptr), (array_ptr)->count()) type_name args) 515 (new ((array_ptr), (array_ptr)->count()) type_name args)
516 516
517 517
518 /** 518 /**
519 * Subclass of SkTArray that contains a preallocated memory block for the array. 519 * Subclass of SkTArray that contains a preallocated memory block for the array.
520 */ 520 */
(...skipping 29 matching lines...) Expand all
550 SkSTArray& operator= (const INHERITED& array) { 550 SkSTArray& operator= (const INHERITED& array) {
551 INHERITED::operator=(array); 551 INHERITED::operator=(array);
552 return *this; 552 return *this;
553 } 553 }
554 554
555 private: 555 private:
556 SkAlignedSTStorage<N,T> fStorage; 556 SkAlignedSTStorage<N,T> fStorage;
557 }; 557 };
558 558
559 #endif 559 #endif
OLDNEW
« no previous file with comments | « include/core/SkPostConfig.h ('k') | include/core/SkTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698