| 402 | |
| 403 | public: |
| 404 | aligned_array(std::size_t size, std::size_t alignment = 64) : size_(size), alignment_(alignment) { |
| 405 | // With `std::aligned_alloc` in C++17, an exception won't be raised, which may be preferred in |
| 406 | // some environments. MSVC was late to adopt it, and developers would often use a combination |
| 407 | // of lower-level `posix_memalign` and `_aligned_malloc`/`_aligned_free` across Unix and Windows. |
| 408 | data_ = (type_ *)::operator new(sizeof(type_) * size_, std::align_val_t(alignment_)); |
| 409 | } |
| 410 | ~aligned_array() noexcept { ::operator delete(data_, sizeof(type_) * size_, std::align_val_t(alignment_)); } |
| 411 | |
| 412 | aligned_array(aligned_array const &) = delete; |
nothing calls this directly
no outgoing calls
no test coverage detected