Chromium Code Reviews| Index: src/shared/platform/posix/aligned_malloc.c |
| =================================================================== |
| --- src/shared/platform/posix/aligned_malloc.c (revision 10196) |
| +++ src/shared/platform/posix/aligned_malloc.c (working copy) |
| @@ -10,10 +10,21 @@ |
| void *NaClAlignedMalloc(size_t size, size_t alignment) { |
| + /* |
| + * Bionic in Android ICS (4.0) and earlier doesn't have |
| + * posix_memalign(), so we shall use memalign(), which |
| + * luckily returns free()'able memory. |
|
Mark Seaborn
2012/11/06 13:54:44
How about: "luckily, in Bionic, returns free()'abl
|
| + * TODO(olonho): once/if we'll obsolete 4.0 support remove this |
| + * #ifdef. |
| + */ |
| +#if NACL_ANDROID |
| + return memalign(alignment, size); |
| +#else |
| void *block; |
| if (posix_memalign(&block, alignment, size) != 0) |
| return NULL; |
| return block; |
| +#endif |
| } |
| void NaClAlignedFree(void *block) { |