| 3599 | |
| 3600 | template<typename TAlign> |
| 3601 | static inline void* aligned_malloc(size_t size) |
| 3602 | { |
| 3603 | MOODYCAMEL_CONSTEXPR_IF (std::alignment_of<TAlign>::value <= std::alignment_of<details::max_align_t>::value) |
| 3604 | return (Traits::malloc)(size); |
| 3605 | else { |
| 3606 | size_t alignment = std::alignment_of<TAlign>::value; |
| 3607 | void* raw = (Traits::malloc)(size + alignment - 1 + sizeof(void*)); |
| 3608 | if (!raw) |
| 3609 | return nullptr; |
| 3610 | char* ptr = details::align_for<TAlign>(reinterpret_cast<char*>(raw) + sizeof(void*)); |
| 3611 | *(reinterpret_cast<void**>(ptr) - 1) = raw; |
| 3612 | return ptr; |
| 3613 | } |
| 3614 | } |
| 3615 | |
| 3616 | template<typename TAlign> |
nothing calls this directly
no test coverage detected