void XYArray::SetAtGrow(int nIndex, XYItem& newVal) { if (nIndex >= AllocSize()) ReAlloc(AllocSize() * 2 + 1); (*this)[nIndex] = newVal; if (nIndex >= Size()) SetSize(nIndex + 1); }
bool SkAutoPixmapStorage::tryAlloc(const SkImageInfo& info) { this->freeStorage(); size_t rb; size_t size = AllocSize(info, &rb); if (0 == size) { return false; } void* pixels = sk_malloc_flags(size, 0); if (nullptr == pixels) { return false; } this->reset(info, pixels, rb); fStorage = pixels; return true; }
ICVector<T>::ICVector(void) { AllocSize(5); }
ICVector<T>::ICVector(int iSize) { AllocSize(iSize); }