Guard all malloc, realloc and free() fonctions with check_that_malloc_is_allowed()

This commit is contained in:
Antoine Hoarau
2023-04-04 04:24:22 +00:00
committed by Rasmus Munk Larsen
parent c730290fa0
commit 9b48d10215
2 changed files with 72 additions and 46 deletions

View File

@@ -225,4 +225,7 @@ EIGEN_DECLARE_TEST(nomalloc)
CALL_SUBTEST_6(test_reference(Matrix<float,32,32>()));
CALL_SUBTEST_7(test_reference(R1));
CALL_SUBTEST_8(Ref<MatrixXd> R2 = M1.topRows<2>(); test_reference(R2));
// freeing is now possible
Eigen::internal::set_is_malloc_allowed(true);
}