aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/util/Memory.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2018-04-03 17:15:38 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2018-04-03 17:15:38 +0200
commit8c7b5158a10af19bb98f2c2b5c57d44fd8899fe8 (patch)
treef40eca5dbbee07cd0931962ea846d4539fa801fb /Eigen/src/Core/util/Memory.h
parentdd4cc6bd9e60d1ab2cef4c66ee922d3d84f3d0b2 (diff)
commit 45e9c9996da790b55ed9c4b0dfeae49492ac5c46 (HEAD -> memory_fix)
Author: George Burgess IV <gbiv@google.com> Date: Thu Mar 1 11:20:24 2018 -0800 Prefer `::operator new` to `new` The C++ standard allows compilers much flexibility with `new` expressions, including eliding them entirely (https://godbolt.org/g/yS6i91). However, calls to `operator new` are required to be treated like opaque function calls. Since we're calling `new` for side-effects other than allocating heap memory, we should prefer the less flexible version. Signed-off-by: George Burgess IV <gbiv@google.com>
Diffstat (limited to 'Eigen/src/Core/util/Memory.h')
-rw-r--r--Eigen/src/Core/util/Memory.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h
index 006b0bfba..53300c388 100644
--- a/Eigen/src/Core/util/Memory.h
+++ b/Eigen/src/Core/util/Memory.h
@@ -70,7 +70,7 @@ inline void throw_std_bad_alloc()
throw std::bad_alloc();
#else
std::size_t huge = static_cast<std::size_t>(-1);
- new int[huge];
+ ::operator new(huge);
#endif
}