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

Unified Diff: src/shared/platform/posix/aligned_malloc.c

Issue 11364047: Android doesn't have posix_memalign(), so use memalign() (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/shared/platform/posix/aligned_malloc.c
===================================================================
--- src/shared/platform/posix/aligned_malloc.c (revision 10167)
+++ src/shared/platform/posix/aligned_malloc.c (working copy)
@@ -8,12 +8,15 @@
#include <stdlib.h>
-
Mark Seaborn 2012/11/02 15:35:57 Don't change the spacing unnecessarily, please. T
Nikolay 2012/11/06 11:09:05 Done.
void *NaClAlignedMalloc(size_t size, size_t alignment) {
+#if NACL_ANDROID
+ return memalign(alignment, size);
Mark Seaborn 2012/11/02 15:35:57 Android added posix_memalign() in December 2011 in
Nikolay 2012/11/06 11:09:05 Done.
+#else
void *block;
if (posix_memalign(&block, alignment, size) != 0)
return NULL;
return block;
+#endif
}
void NaClAlignedFree(void *block) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698