MCPcopy Create free account
hub / github.com/Derious/cuMPC / aligned_realloc

Function aligned_realloc

dependence/eigen-3.4.0/Eigen/src/Core/util/Memory.h:215–230  ·  view source on GitHub ↗

* \internal * \brief Reallocates an aligned block of memory. * \throws std::bad_alloc on allocation failure */

Source from the content-addressed store, hash-verified

213 * \throws std::bad_alloc on allocation failure
214 */
215inline 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 ***

Callers 1

Calls 2

handmade_aligned_reallocFunction · 0.85
throw_std_bad_allocFunction · 0.85

Tested by

no test coverage detected