|
1 | | -diff -aur target-org/webkit/Source/bmalloc/bmalloc/DebugHeap.cpp target/webkit/Source/bmalloc/bmalloc/DebugHeap.cpp |
2 | | ---- target-org/webkit/Source/bmalloc/bmalloc/DebugHeap.cpp 2017-02-03 22:59:08.000000000 +0100 |
3 | | -+++ target/webkit/Source/bmalloc/bmalloc/DebugHeap.cpp 2017-08-02 10:07:11.000383124 +0200 |
4 | | -@@ -89,13 +89,8 @@ |
| 1 | +diff -aur target-org/webkit/Source/bmalloc/CMakeLists.txt target/webkit/Source/bmalloc/CMakeLists.txt |
| 2 | +--- target-org/webkit/Source/bmalloc/CMakeLists.txt 2018-07-12 11:27:26.185794000 -0700 |
| 3 | ++++ target/webkit/Source/bmalloc/CMakeLists.txt 2019-06-11 12:20:28.556676100 -0700 |
| 4 | +@@ -32,6 +32,7 @@ |
| 5 | + bmalloc/VMHeap.cpp |
| 6 | + bmalloc/bmalloc.cpp |
| 7 | + bmalloc/mbmalloc.cpp |
| 8 | ++ bmalloc/posix_memalign.cpp |
| 9 | + ) |
5 | 10 |
|
6 | | - void* DebugHeap::memalign(size_t alignment, size_t size, bool crashOnFailure) |
7 | | - { |
8 | | -- void* result; |
9 | | -- if (posix_memalign(&result, alignment, size)) { |
10 | | -- if (crashOnFailure) |
11 | | -- BCRASH(); |
12 | | -- return nullptr; |
13 | | -- } |
14 | | -- return result; |
15 | | -+ BCRASH(); |
16 | | -+ return nullptr; |
17 | | - } |
| 11 | + if (CMAKE_SYSTEM_NAME MATCHES "Darwin") |
18 | 12 |
|
19 | | - void* DebugHeap::realloc(void* object, size_t size) |
| 13 | + |
| 14 | +diff -aur /dev/null target/webkit/Source/bmalloc/bmalloc/posix_memalign.cpp |
| 15 | +--- /dev/null 2019-06-11 10:46:36.937580800 -0700 |
| 16 | ++++ target/webkit/Source/bmalloc/bmalloc/posix_memalign.cpp 2019-06-11 14:47:32.119738900 -0700 |
| 17 | +@@ -0,0 +1,23 @@ |
| 18 | ++#if defined(__ANDROID__) && __ANDROID_API__ < 17 |
| 19 | ++// |
| 20 | ++// Implementation borrowed from the Android Support Library |
| 21 | ++// https://android.googlesource.com/platform/ndk/+/c066f37aeadeb8a8b21468ad8c82f4469fb5a70d/sources/android/support/src/posix_memalign.cpp |
| 22 | ++// |
| 23 | ++#include <errno.h> |
| 24 | ++#include <malloc.h> |
| 25 | ++#include <stdlib.h> |
| 26 | ++ |
| 27 | ++int posix_memalign(void** memptr, size_t alignment, size_t size) { |
| 28 | ++ if ((alignment & (alignment - 1)) != 0 || alignment == 0) { |
| 29 | ++ return EINVAL; |
| 30 | ++ } |
| 31 | ++ if (alignment % sizeof(void*) != 0) { |
| 32 | ++ return EINVAL; |
| 33 | ++ } |
| 34 | ++ *memptr = memalign(alignment, size); |
| 35 | ++ if (*memptr == NULL) { |
| 36 | ++ return errno; |
| 37 | ++ } |
| 38 | ++ return 0; |
| 39 | ++} |
| 40 | ++#endif |
0 commit comments