示例#1
0
void XYArray::SetAtGrow(int nIndex, XYItem& newVal)
{
    if (nIndex >= AllocSize())
        ReAlloc(AllocSize() * 2 + 1);
    (*this)[nIndex] = newVal;
    if (nIndex >= Size())
        SetSize(nIndex + 1);
}
示例#2
0
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;
}
示例#3
0
文件: cvector.cpp 项目: dblock/agnes
ICVector<T>::ICVector(void) {  
  AllocSize(5);
}
示例#4
0
文件: cvector.cpp 项目: dblock/agnes
ICVector<T>::ICVector(int iSize) {
  AllocSize(iSize);
}