Lines Matching defs:count

36  *  Returns a pointer to a D which comes immediately after S[count].
38 template <typename D, typename S> static D* SkTAfter(S* ptr, size_t count = 1) {
39 return reinterpret_cast<D*>(ptr + count);
83 /** Allocate count number of T elements
85 explicit SkAutoTArray(int count) {
86 SkASSERT(count >= 0);
87 if (count) {
88 fArray.reset(new T[count]);
90 SkDEBUGCODE(fCount = count;)
104 /** Reallocates given a new count. Reallocation occurs even if new count equals old count.
106 void reset(int count = 0) { *this = SkAutoTArray(count); }
108 /** Return the array of T elements. Will be NULL if count == 0
143 /** Allocate count number of T elements
145 SkAutoSTArray(int count) {
148 this->reset(count);
155 /** Destroys previous objects in the array and default constructs count number of objects */
156 void reset(int count) {
163 SkASSERT(count >= 0);
164 if (fCount != count) {
171 if (count > kCount) {
172 fArray = (T*) sk_malloc_throw(count, sizeof(T));
173 } else if (count > 0) {
179 fCount = count;
183 T* stop = fArray + count;
191 int count() const { return fCount; }
193 /** Return the array of T elements. Will be NULL if count == 0
246 /** Allocates space for 'count' Ts. */
247 explicit SkAutoTMalloc(size_t count)
248 : fPtr(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr) {}
254 void realloc(size_t count) {
255 fPtr.reset(count ? (T*)sk_realloc_throw(fPtr.release(), count * sizeof(T)) : nullptr);
259 T* reset(size_t count = 0) {
260 fPtr.reset(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr);
297 SkAutoSTMalloc(size_t count) {
298 if (count > kCount) {
299 fPtr = (T*)sk_malloc_throw(count, sizeof(T));
300 } else if (count) {
319 T* reset(size_t count) {
323 if (count > kCount) {
324 fPtr = (T*)sk_malloc_throw(count, sizeof(T));
325 } else if (count) {
356 void realloc(size_t count) {
357 if (count > kCount) {
359 fPtr = (T*)sk_malloc_throw(count, sizeof(T));
362 fPtr = (T*)sk_realloc_throw(fPtr, count, sizeof(T));
364 } else if (count) {
366 fPtr = (T*)sk_realloc_throw(fPtr, count, sizeof(T));