summaryrefslogtreecommitdiffstats
path: root/compiler/utils/arena_allocator.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2014-06-10 14:47:51 +0100
committerVladimir Marko <vmarko@google.com>2014-06-10 14:47:51 +0100
commit22a0ef8fbe78577ad4127e5becf20b3afa797478 (patch)
tree968dd8f4182dde285285cb38db95d56c77c70edf /compiler/utils/arena_allocator.cc
parent608f63bae4ed0dc0cd6462d0df3d15c28f37f0b2 (diff)
downloadart-22a0ef8fbe78577ad4127e5becf20b3afa797478.tar.gz
art-22a0ef8fbe78577ad4127e5becf20b3afa797478.tar.bz2
art-22a0ef8fbe78577ad4127e5becf20b3afa797478.zip
Round up arena allocations to 8 bytes.
Prevent SIGBUS/BUS_ADRALN when we use the arena for classes with 64-bit alignment. Change-Id: I5382ed7072fcfb2349f61558e1fd8257315ee336
Diffstat (limited to 'compiler/utils/arena_allocator.cc')
-rw-r--r--compiler/utils/arena_allocator.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/utils/arena_allocator.cc b/compiler/utils/arena_allocator.cc
index ca4635d352..6a39641f38 100644
--- a/compiler/utils/arena_allocator.cc
+++ b/compiler/utils/arena_allocator.cc
@@ -215,7 +215,7 @@ void ArenaAllocator::UpdateBytesAllocated() {
}
void* ArenaAllocator::AllocValgrind(size_t bytes, ArenaAllocKind kind) {
- size_t rounded_bytes = (bytes + 3 + kValgrindRedZoneBytes) & ~3;
+ size_t rounded_bytes = RoundUp(bytes + kValgrindRedZoneBytes, 8);
if (UNLIKELY(ptr_ + rounded_bytes > end_)) {
// Obtain a new block.
ObtainNewArenaForAllocation(rounded_bytes);