Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/intgemm/intgemm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolay Bogoychev <nheart@gmail.com>2020-01-22 19:53:42 +0300
committerNikolay Bogoychev <nheart@gmail.com>2020-01-22 19:53:42 +0300
commit1cd6f6b83a8e110ac3e44d7d1effdec65bbe9bb6 (patch)
tree463fd2cea034645fa192cd18c12d42117b895816
parent339f8f6b96ab2efe162c5bc3a72326393413e6ca (diff)
Make aligned_alloc compliant with the specifications
-rw-r--r--aligned.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/aligned.h b/aligned.h
index c07c23e..b5512ba 100644
--- a/aligned.h
+++ b/aligned.h
@@ -9,7 +9,7 @@ namespace intgemm {
template <class T> class AlignedVector {
public:
explicit AlignedVector(std::size_t size)
- : mem_(static_cast<T*>(aligned_alloc(64, std::max((size_t)64, size * sizeof(T))))), size_(size) {
+ : mem_(static_cast<T*>(aligned_alloc(64, (size * sizeof(T) + 63) & ~63))), size_(size) {
}
AlignedVector(const AlignedVector&) = delete;