Allocate internal storage for this object.
| 2368 | |
| 2369 | // Allocate internal storage for this object. |
| 2370 | int32 FixedSetAllocator::Allocate( |
| 2371 | const int32 itemSize, const int32 count) |
| 2372 | { |
| 2373 | Clear(); |
| 2374 | if (count) |
| 2375 | { |
| 2376 | m_buffer = m_allocator->Allocate( |
| 2377 | (itemSize + sizeof(*m_valid)) * count); |
| 2378 | b2Assert(m_buffer); |
| 2379 | m_valid = (int8*)m_buffer + (itemSize * count); |
| 2380 | memset(m_valid, 1, sizeof(*m_valid) * count); |
| 2381 | m_count = count; |
| 2382 | } |
| 2383 | return m_count; |
| 2384 | } |
| 2385 | |
| 2386 | // Deallocate the internal buffer if it's allocated. |
| 2387 | void FixedSetAllocator::Clear() |
no test coverage detected