diff options
author | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2018-11-01 13:23:19 +0100 |
---|---|---|
committer | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2018-11-01 13:23:19 +0100 |
commit | 66b28e290d426899bda932fa3b0617d63b3a2a75 (patch) | |
tree | f1b3074829e8aebe6be655fcd8ddd17047a4b5b4 /Eigen/src/Core/util/Memory.h | |
parent | 07fcdd14386d9356fba55da9bf839047b3ea5b8a (diff) |
bug #1618: Use different power-of-2 check to avoid MSVC warning
Diffstat (limited to 'Eigen/src/Core/util/Memory.h')
-rw-r--r-- | Eigen/src/Core/util/Memory.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index 6664770f3..a135761d6 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -98,7 +98,7 @@ inline void throw_std_bad_alloc() */ EIGEN_DEVICE_FUNC inline void* handmade_aligned_malloc(std::size_t size, std::size_t alignment = EIGEN_DEFAULT_ALIGN_BYTES) { - eigen_assert(alignment >= sizeof(void*) && (alignment & -alignment) == alignment && "Alignment must be at least sizeof(void*) and a power of 2"); + eigen_assert(alignment >= sizeof(void*) && (alignment & (alignment-1)) == 0 && "Alignment must be at least sizeof(void*) and a power of 2"); #if defined(EIGEN_HIP_DEVICE_COMPILE) void *original = ::malloc(size+alignment); |