20 #ifndef __TPIE_PIPELINING_PARALLEL_ALIGNED_ARRAY_H__
21 #define __TPIE_PIPELINING_PARALLEL_ALIGNED_ARRAY_H__
25 namespace pipelining {
27 namespace parallel_bits {
40 template <
typename T,
size_t Align>
44 static const size_t aligned_size = (
sizeof(T)+Align-1)/Align*Align;
60 const size_t addr = (size_t) m_data;
64 const size_t alignedBase = (addr + Align - 1)/Align*Align;
67 const size_t elmAddress = alignedBase + aligned_size * idx;
69 return (T *) elmAddress;
72 void realloc(
size_t elms) {
78 m_data = m_size ?
new uint8_t[aligned_size * elms + Align] : 0;
81 size_t size()
const {
return m_size; }
90 #endif // __TPIE_PIPELINING_PARALLEL_ALIGNED_ARRAY_H__
Aligned, uninitialized storage.