56 inline int posix_memalign(
void **p,
size_t a,
size_t s)
58 *p = _aligned_malloc(s, a);
59 return ( *p == NULL ) ? errno : 0;
87 if( posix_memalign(&p_ptr_alloc,
CD_ALIGN, sz) != 0 )
89 p_ptr.push_back(p_ptr_alloc);
102 for(
size_t i=0; i <
p_ptr.size(); ++i )
107 void* p_ptr_alloc = NULL;
108 for(
size_t i=0; i <
p_ptr.size(); i++ )
112 p_ptr_alloc =
p_ptr[i];
117 if( p_ptr_alloc == NULL )
120 p_ptr_alloc =
p_ptr.back();
127 for( i=0; i <
p_ptr.size(); i++ )
129 if(
p_ptr[i] == p_ptr_alloc )
158 while(
p_ptr.back() == NULL )
169 template<
class T,
bool lgBC=lgBOUNDSCHECKVAL>
187 size_t sz = size_t(
max(end-begin,0)*
sizeof(T));
222 if( lgBC && ( i < p_begin || i >=
p_end ) )
228 if( lgBC && ( i < p_begin || i >=
p_end ) )
279 #if __cplusplus >= 201103L
280 typedef true_type propagate_on_container_move_assignment;
302 #if __cplusplus >= 201103L
303 typedef true_type propagate_on_container_move_assignment;
318 if( posix_memalign(&p,
CD_ALIGN, n*
sizeof(T)) != 0 )
329 template<
class T,
class U>
341 template<
class T,
class U>
353 #if __cplusplus >= 201103L
356 using vector_avx =
typename std::vector<T,allocator_avx<T>>;
void posix_memalign_free(void *p)
static const size_t p_min_size
void avx_free(void *p_ptr_alloc)
ptrdiff_t difference_type
allocator_avx(const allocator_avx< U > &)
void p_alloc(size_t sz, bool lgUsed)
ptrdiff_t difference_type
NORETURN void OUT_OF_RANGE(const char *str)
bool operator!=(const count_ptr< T > &a, const count_ptr< T > &b)
void * avx_alloc(size_t sz)
void deallocate(pointer p, size_type)
reference operator[](long i)
void p_alloc(long begin, long end)
const T & const_reference
bool operator==(const count_ptr< T > &a, const count_ptr< T > &b)
const void * const_pointer
avx_ptr(long begin, long end)
allocator_avx(const allocator_avx &a)
const T & const_reference
pointer allocate(size_type n, typename allocator_avx< void >::const_pointer=NULL)
static const size_t p_def_size