| 4249 | |
| 4250 | template <typename TAlign> |
| 4251 | static inline void *aligned_malloc(size_t size) { |
| 4252 | MOODYCAMEL_CONSTEXPR_IF(std::alignment_of<TAlign>::value <= |
| 4253 | std::alignment_of<details::max_align_t>::value) |
| 4254 | return (Traits::malloc)(size); |
| 4255 | else { |
| 4256 | size_t alignment = std::alignment_of<TAlign>::value; |
| 4257 | void *raw = (Traits::malloc)(size + alignment - 1 + sizeof(void *)); |
| 4258 | if (!raw) return nullptr; |
| 4259 | char *ptr = details::align_for<TAlign>(reinterpret_cast<char *>(raw) + |
| 4260 | sizeof(void *)); |
| 4261 | *(reinterpret_cast<void **>(ptr) - 1) = raw; |
| 4262 | return ptr; |
| 4263 | } |
| 4264 | } |
| 4265 | |
| 4266 | template <typename TAlign> |
nothing calls this directly
no test coverage detected