コード例 #1
0
ファイル: raw_allocator.hpp プロジェクト: songhtdo/vespa
typename RawAllocator<EntryT, RefT>::HandleType
RawAllocator<EntryT, RefT>::alloc(size_t numElems, size_t extraElems)
{
    _store.ensureBufferCapacity(_typeId, numElems + extraElems);
    uint32_t activeBufferId = _store.getActiveBufferId(_typeId);
    BufferState &state = _store.getBufferState(activeBufferId);
    assert(state.isActive());
    size_t oldBufferSize = state.size();
    EntryT *buffer = _store.getBufferEntry<EntryT>(activeBufferId, oldBufferSize);
    state.pushed_back(numElems);
    return HandleType(RefT(oldBufferSize, activeBufferId), buffer);
}
コード例 #2
0
 result_type operator() (ArgT const& arg) const
 {
     m_ref = RefT(arg);
 }