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

Unified Diff: runtime/vm/os_macos.cc

Issue 11416291: Fix win32 build breakage (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add TODO to test Created 8 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 | « no previous file | runtime/vm/os_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/os_macos.cc
diff --git a/runtime/vm/os_macos.cc b/runtime/vm/os_macos.cc
index 1e7c4f670e91c22eb4c02ff6b3cb0be413090744..9af9907cd4ab8dd049d8391e05008e2cb58f83a6 100644
--- a/runtime/vm/os_macos.cc
+++ b/runtime/vm/os_macos.cc
@@ -72,13 +72,12 @@ void* OS::AlignedAllocate(intptr_t size, intptr_t alignment) {
const int kMinimumAlignment = 16;
ASSERT(Utils::IsPowerOfTwo(alignment));
ASSERT(alignment >= kMinimumAlignment);
- void* p = NULL;
- int r;
- r = posix_memalign(&p, alignment, size);
- if (p == NULL) {
- UNREACHABLE();
- }
- return p;
+ // Temporary workaround until xcode is upgraded.
+ // Mac guarantees malloc returns a 16 byte aligned memory chunk.
+ // Currently we only allocate with 16-bye alignment.
+ ASSERT(alignment == 16);
+ // TODO(johnmccutchan): Remove hack and switch to posix_memalign.
+ return malloc(size);
}
« no previous file with comments | « no previous file | runtime/vm/os_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698