* \internal * \brief Reallocates an aligned block of memory. * \throws std::bad_alloc on allocation failure */
| 213 | * \throws std::bad_alloc on allocation failure |
| 214 | */ |
| 215 | inline void* aligned_realloc(void *ptr, std::size_t new_size, std::size_t old_size) |
| 216 | { |
| 217 | EIGEN_UNUSED_VARIABLE(old_size) |
| 218 | |
| 219 | void *result; |
| 220 | #if (EIGEN_DEFAULT_ALIGN_BYTES==0) || EIGEN_MALLOC_ALREADY_ALIGNED |
| 221 | result = std::realloc(ptr,new_size); |
| 222 | #else |
| 223 | result = handmade_aligned_realloc(ptr,new_size,old_size); |
| 224 | #endif |
| 225 | |
| 226 | if (!result && new_size) |
| 227 | throw_std_bad_alloc(); |
| 228 | |
| 229 | return result; |
| 230 | } |
| 231 | |
| 232 | /***************************************************************************** |
| 233 | *** Implementation of conditionally aligned functions *** |
no test coverage detected