2016-09-16 Jonathan Wakely <jwakely@redhat.com>
Marc Glisse <marc.glisse@inria.fr>
* libsupc++/new_opa.cc [_GLIBCXX_HAVE_ALIGNED_ALLOC]
(operator new(size_t, align_val_t)): Replace modulus operator with
mask.
Co-Authored-By: Marc Glisse <marc.glisse@inria.fr>
From-SVN: r240192
+2016-09-16 Jonathan Wakely <jwakely@redhat.com>
+ Marc Glisse <marc.glisse@inria.fr>
+
+ * libsupc++/new_opa.cc [_GLIBCXX_HAVE_ALIGNED_ALLOC]
+ (operator new(size_t, align_val_t)): Replace modulus operator with
+ mask.
+
2016-09-16 Jonathan Wakely <jwakely@redhat.com>
* libsupc++/new_opa.cc [_GLIBCXX_HAVE_POSIX_MEMALIGN] (aligned_alloc):
#if _GLIBCXX_HAVE_ALIGNED_ALLOC
/* C11: the value of size shall be an integral multiple of alignment. */
- if (std::size_t rem = sz % align)
+ if (std::size_t rem = sz & (align - 1))
sz += align - rem;
#endif