diff options
Diffstat (limited to 'lib/Core/MemoryManager.cpp')
-rw-r--r-- | lib/Core/MemoryManager.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Core/MemoryManager.cpp b/lib/Core/MemoryManager.cpp index 24e2ed97..f40e8bc9 100644 --- a/lib/Core/MemoryManager.cpp +++ b/lib/Core/MemoryManager.cpp @@ -111,9 +111,12 @@ MemoryObject *MemoryManager::allocate(uint64_t size, bool isLocal, uint64_t address = 0; if (DeterministicAllocation) { - +#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) + address = llvm::alignTo((uint64_t)nextFreeSlot + alignment - 1, alignment); +#else address = llvm::RoundUpToAlignment((uint64_t)nextFreeSlot + alignment - 1, alignment); +#endif // Handle the case of 0-sized allocations as 1-byte allocations. // This way, we make sure we have this allocation between its own red zones |