summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/AllocatorTest.cpp
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2019-10-14 13:14:34 +0000
committerGuillaume Chatelet <gchatelet@google.com>2019-10-14 13:14:34 +0000
commitce56e1a1cc5714f4af5675dd963cfebed766d9e1 (patch)
tree45c6eae172f40a05492dc6566b21e66a836e41ff /llvm/unittests/Support/AllocatorTest.cpp
parent77748129650271ebd7b3f9c2c6c4f8110cb4a845 (diff)
downloadbcm5719-llvm-ce56e1a1cc5714f4af5675dd963cfebed766d9e1.tar.gz
bcm5719-llvm-ce56e1a1cc5714f4af5675dd963cfebed766d9e1.zip
[Alignment][NFC] Move and type functions from MathExtras to Alignment
Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68942 llvm-svn: 374773
Diffstat (limited to 'llvm/unittests/Support/AllocatorTest.cpp')
-rw-r--r--llvm/unittests/Support/AllocatorTest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/unittests/Support/AllocatorTest.cpp b/llvm/unittests/Support/AllocatorTest.cpp
index a0223ea932b..8a07ddda130 100644
--- a/llvm/unittests/Support/AllocatorTest.cpp
+++ b/llvm/unittests/Support/AllocatorTest.cpp
@@ -145,8 +145,8 @@ public:
void *Allocate(size_t Size, size_t /*Alignment*/) {
// Allocate space for the alignment, the slab, and a void* that goes right
// before the slab.
- size_t Alignment = 4096;
- void *MemBase = safe_malloc(Size + Alignment - 1 + sizeof(void*));
+ Align Alignment(4096);
+ void *MemBase = safe_malloc(Size + Alignment.value() - 1 + sizeof(void *));
// Find the slab start.
void *Slab = (void *)alignAddr((char*)MemBase + sizeof(void *), Alignment);
OpenPOWER on IntegriCloud