Ejemplo n.º 1
0
void Buffer::_reserve_aux(Uint32 cap)
{
    if (_rep->cap == 0)
    {
        _rep = _allocate(cap, _minCap);
        _rep->size = 0;
    }
    else
        _rep = _reallocate(_rep, _next_pow_2(cap, _minCap));
}
Ejemplo n.º 2
0
void Allocator::_ensure(aindex_t next, size32_t iSize)
{
    aindex_t req = used + next;
    if (req > max )
    {
        if ((max == 0) && (req < DOUBLE_LIMIT))
            max = ensurePowerOfTwo(req);
        _reallocate(req, iSize);
    }
}
Ejemplo n.º 3
0
status_t MediaBuffer::copyData(void * data, const uint32_t size)
{
    status_t ret = NO_ERROR;
    if (data == nullptr) return INVALID_OPERATION;
    if (size > _mCapacity) {
        if ((ret = _reallocate(size)) != NO_ERROR) return ret;
    }
    std::memcpy(_mData, data, size);
    _mSize = size;
    return NO_ERROR;
}
Ejemplo n.º 4
0
void Buffer::_append_char_aux()
{
    if (_rep->cap == 0)
    {
        _rep = _allocate(_minCap, _minCap);
        _rep->size = 0;
    }
    else
    {
        // Check for potential overflow.
        PEGASUS_CHECK_CAPACITY_OVERFLOW(_rep->cap);
        _rep = _reallocate(_rep, _rep->cap ? (2 * _rep->cap) : _minCap);
    }
}
Ejemplo n.º 5
0
void eIBitmapOp::_preExecute()
{
    // bitmap operators always operate on
    // smallest input bitmap operator size
    if (getAboveOpCount() > 0)
    {
        eSize size(eS32_MAX, eS32_MAX);

        for (eU32 i=0; i<getAboveOpCount(); i++)
        {
            const Result &res = ((eIBitmapOp *)getAboveOp(i))->getResult();
            size.minComponents(eSize(res.uav->tex->width, res.uav->tex->height));
        }

        _reallocate(size.x, size.y);
    }
}
Ejemplo n.º 6
0
    virtual void _preExecute(eGraphicsApiDx9 *gfx)
    {
        // If there's at least one input operator, set
        // our self to the size of this input operator
        // (all input operators have the same bitmap
        // size, so it doesn't matter which one).
        // Further more, bitmap operators only allow
        // bitmap operators as input, so it's impossible
        // to get an operator of another type as input.
        
        if (getInputCount() > 0)
        {
            eIBitmapOp *op = (eIBitmapOp *)getInputOperator(0);
            eASSERT(op != eNULL);
            eASSERT(TEST_CATEGORY(op, "Bitmap", Bitmap_CID));

            _reallocate(op->getResult().width, op->getResult().height);
        }
    }
Ejemplo n.º 7
0
void Allocator::_space(size32_t iSize)
{
    if ( used == max )
        _reallocate(used+1, iSize);
    used++;
}