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

Unified Diff: src/zone-inl.h

Issue 8539008: 8-byte align zone allocations of objects that may require it. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 1 month 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 | « src/zone.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/zone-inl.h
===================================================================
--- src/zone-inl.h (revision 9962)
+++ src/zone-inl.h (working copy)
@@ -53,6 +53,14 @@
// Round up the requested size to fit the alignment.
size = RoundUp(size, kAlignment);
+ // If the allocation size is divisible by 8 then we return an 8-byte aligned
+ // address.
+ if (kPointerSize == 4 && kAlignment == 4) {
+ position_ += ((~size) & 4) & (reinterpret_cast<intptr_t>(position_) & 4);
+ } else {
+ ASSERT(kAlignment >= kPointerSize);
+ }
+
// Check if the requested size is available without expanding.
Address result = position_;
« no previous file with comments | « src/zone.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698