From 0a72447fb90b7d8ab0ab07119098a46ba84f0c86 Mon Sep 17 00:00:00 2001 From: "jvoung@chromium.org" Date: Thu, 28 Nov 2013 05:59:44 +0000 Subject: Use posix_memalign for OS_NACL instead of memalign, remove TODO for docs. We finally added it to the nacl newlib headers. Besides the headers there used to be a bug in the posix_memalign implementation which prevented it from being useful. That's also fixed. BUG=138579 Review URL: https://codereview.chromium.org/89703005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237695 0039d316-1c4b-4281-b951-d872f2087c98 --- base/memory/aligned_memory.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/base/memory/aligned_memory.cc b/base/memory/aligned_memory.cc index b6278ab..5ec88b1 100644 --- a/base/memory/aligned_memory.cc +++ b/base/memory/aligned_memory.cc @@ -6,7 +6,7 @@ #include "base/logging.h" -#if defined(OS_ANDROID) || defined(OS_NACL) +#if defined(OS_ANDROID) #include #endif @@ -19,13 +19,12 @@ void* AlignedAlloc(size_t size, size_t alignment) { void* ptr = NULL; #if defined(COMPILER_MSVC) ptr = _aligned_malloc(size, alignment); -// Both Android and NaCl technically support posix_memalign(), but do not expose -// it in the current version of the library headers used by Chrome. Luckily, -// memalign() on both platforms returns pointers which can safely be used with -// free(), so we can use it instead. Issues filed with each project for docs: +// Android technically supports posix_memalign(), but does not expose it in +// the current version of the library headers used by Chrome. Luckily, +// memalign() on Android returns pointers which can safely be used with +// free(), so we can use it instead. Issue filed to document this: // http://code.google.com/p/android/issues/detail?id=35391 -// http://code.google.com/p/chromium/issues/detail?id=138579 -#elif defined(OS_ANDROID) || defined(OS_NACL) +#elif defined(OS_ANDROID) ptr = memalign(alignment, size); #else if (posix_memalign(&ptr, alignment, size)) -- cgit v1.1