From b7e21d4e389dd65ed020a92b455f3198a8350795 Mon Sep 17 00:00:00 2001 From: Florian Richer Date: Mon, 5 Sep 2022 09:11:08 +0200 Subject: [PATCH] Call check_that_malloc_is_allowed() in aligned_realloc() --- Eigen/src/Core/util/Memory.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index 9823fa30f..af4b68e8e 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -229,6 +229,11 @@ inline void* aligned_realloc(void *ptr, std::size_t new_size, std::size_t old_si if (!result && new_size) throw_std_bad_alloc(); +#ifdef EIGEN_RUNTIME_NO_MALLOC + if (result != ptr) + check_that_malloc_is_allowed(); +#endif + return result; }