Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Unified Diff: runtime/vm/zone.h

Issue 832713006: Double-align Zone allocations to fix MIPS issue. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/globals.h ('k') | runtime/vm/zone.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/zone.h
===================================================================
--- runtime/vm/zone.h (revision 42786)
+++ runtime/vm/zone.h (working copy)
@@ -67,6 +67,7 @@
large_segments_(NULL),
handles_(),
previous_(NULL) {
+ ASSERT(Utils::IsAligned(position_, kAlignment));
#ifdef DEBUG
// Zap the entire initial buffer.
memset(initial_buffer_.pointer(), kZapUninitializedByte,
@@ -84,7 +85,7 @@
}
// All pointers returned from AllocateUnsafe() and New() have this alignment.
- static const intptr_t kAlignment = kWordSize;
+ static const intptr_t kAlignment = kDoubleSize;
// Default initial chunk size.
static const intptr_t kInitialChunkSize = 1 * KB;
@@ -121,7 +122,8 @@
// This would act as the initial stack allocated chunk so that we don't
// end up calling malloc/free on zone scopes that allocate less than
// kChunkSize
- uint8_t buffer_[kInitialChunkSize];
+ COMPILE_ASSERT(kAlignment <= 8);
+ ALIGN8 uint8_t buffer_[kInitialChunkSize];
MemoryRegion initial_buffer_;
// The free region in the current (head) segment or the initial buffer is
« no previous file with comments | « runtime/vm/globals.h ('k') | runtime/vm/zone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698