20 #ifndef __TPIE_PIPELINING_PARALLEL_ALIGNED_ARRAY_H__
21 #define __TPIE_PIPELINING_PARALLEL_ALIGNED_ARRAY_H__
27 namespace pipelining {
29 namespace parallel_bits {
42 template <
typename T,
size_t Align>
46 static const size_t aligned_size = (
sizeof(T)+Align-1)/Align*Align;
62 const size_t addr = (size_t) m_data;
66 const size_t alignedBase = (addr + Align - 1)/Align*Align;
69 const size_t elmAddress = alignedBase + aligned_size * idx;
71 return (T *) elmAddress;
74 void realloc(
size_t elms) {
80 m_data = m_size ?
new uint8_t[aligned_size * elms + Align] : 0;
83 size_t size()
const {
return m_size; }
92 #endif // __TPIE_PIPELINING_PARALLEL_ALIGNED_ARRAY_H__
Aligned, uninitialized storage.