allocate array of \p nCount elements The address returned is aligned by \p nAlign boundary. \p nAlign parameter should be power of 2. The function guarantees the alignment for first element of array only. To guarantee the alignment for each element of the array the size of an object of type \p T must be multiple of \p nAlign: \code
| 149 | In no memory situation the function throws \p std::bad_alloc exception. |
| 150 | */ |
| 151 | pointer allocate( size_type nAlign, size_type nCount ) |
| 152 | { |
| 153 | assert( cds::beans::is_power2( nAlign )); |
| 154 | pointer p = reinterpret_cast<T *>( cds::OS::aligned_malloc( sizeof(T) * nCount, nAlign )); |
| 155 | if ( !p ) |
| 156 | CDS_THROW_EXCEPTION( std::bad_alloc()); |
| 157 | assert( cds::details::is_aligned( p, nAlign )); |
| 158 | return p; |
| 159 | } |
| 160 | |
| 161 | /// allocate array of \p nCount elements, ignore hint |
| 162 | /** |
no test coverage detected