From 8df3bb5d1d9e2cd2409888b374151202bb424a01 Mon Sep 17 00:00:00 2001 From: shentianzhou Date: Thu, 29 Apr 2021 18:31:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E6=8D=A2=E6=88=90c++=5Fstatic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- README_cn.md | 2 +- demo/build.gradle | 4 ++-- library/build.gradle | 3 ++- library/src/main/cpp/MemoryCache.h | 4 ++-- library/src/main/cpp/Raphael.h | 1 - .../main/java/com/bytedance/raphael/RaphaelReceiver.java | 6 +++--- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index a729349..7cf66ec 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ allprojects { Step 2: Add the dependency ```gradle dependencies { - implementation 'com.github.bytedance:memory-leak-detector:0.0.9' + implementation 'com.github.bytedance:memory-leak-detector:0.1.1' } ``` diff --git a/README_cn.md b/README_cn.md index d236dc4..7703b2d 100644 --- a/README_cn.md +++ b/README_cn.md @@ -24,7 +24,7 @@ allprojects { Step 2: Add the dependency ```gradle dependencies { - implementation 'com.github.bytedance:memory-leak-detector:0.0.9' + implementation 'com.github.bytedance:memory-leak-detector:0.1.1' } ``` diff --git a/demo/build.gradle b/demo/build.gradle index 6e333a5..f7e9e1f 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -17,7 +17,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) -// api project(':library') + api project(':library') implementation 'com.android.support:appcompat-v7:28.0.0' - implementation 'com.github.bytedance:memory-leak-detector:0.0.9' +// implementation 'com.github.bytedance:memory-leak-detector:0.1.1' } \ No newline at end of file diff --git a/library/build.gradle b/library/build.gradle index 9f3c9cd..9ffd5c6 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -3,6 +3,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion 28 + defaultConfig { minSdkVersion 14 targetSdkVersion 28 @@ -11,7 +12,7 @@ android { cmake { cppFlags "-fvisibility=hidden" abiFilters 'armeabi-v7a', 'arm64-v8a' - arguments "-DANDROID_ARM_MODE=arm", "-DANDROID_STL=c++_shared" + arguments "-DANDROID_ARM_MODE=arm", "-DANDROID_STL=c++_static" } } } diff --git a/library/src/main/cpp/MemoryCache.h b/library/src/main/cpp/MemoryCache.h index 777febf..17332ba 100755 --- a/library/src/main/cpp/MemoryCache.h +++ b/library/src/main/cpp/MemoryCache.h @@ -21,14 +21,14 @@ #include "AllocPool.hpp" #if defined(__LP64__) -#define STACK_FORMAT_HEADER "\n0x%016lx, %u\n" +#define STACK_FORMAT_HEADER "\n0x%016lx, %u, 1\n" #define STACK_FORMAT_UNKNOWN "0x%016lx \n" #define STACK_FORMAT_ANONYMOUS "0x%016lx \n" #define STACK_FORMAT_FILE "0x%016lx %s\n" #define STACK_FORMAT_FILE_NAME "0x%016lx %s (%s)\n" #define STACK_FORMAT_FILE_NAME_LINE "0x%016lx %s (%s + %lu)\n" #else -#define STACK_FORMAT_HEADER "\n0x%08x, %u\n" +#define STACK_FORMAT_HEADER "\n0x%08x, %u, 1\n" #define STACK_FORMAT_UNKNOWN "0x%08x \n" #define STACK_FORMAT_ANONYMOUS "0x%08x \n" #define STACK_FORMAT_FILE "0x%08x %s\n" diff --git a/library/src/main/cpp/Raphael.h b/library/src/main/cpp/Raphael.h index f722d53..6ac8cbf 100755 --- a/library/src/main/cpp/Raphael.h +++ b/library/src/main/cpp/Raphael.h @@ -22,7 +22,6 @@ #define MAP64_MODE 0x00800000 #define ALLOC_MODE 0x00400000 -#define CACHE_MASK 0x00200000 #define DEPTH_MASK 0x001F0000 #define LIMIT_MASK 0x0000FFFF diff --git a/library/src/main/java/com/bytedance/raphael/RaphaelReceiver.java b/library/src/main/java/com/bytedance/raphael/RaphaelReceiver.java index 44b70a2..f309e70 100644 --- a/library/src/main/java/com/bytedance/raphael/RaphaelReceiver.java +++ b/library/src/main/java/com/bytedance/raphael/RaphaelReceiver.java @@ -24,7 +24,7 @@ import java.io.File; /** - * adb shell am broadcast -a com.bytedance.raphael.ACTION_START -f 0x01000000 --es configs 0x03F1000 --es regex ".*\\.so$" + * adb shell am broadcast -a com.bytedance.raphael.ACTION_START -f 0x01000000 --es configs 0xCF0400 --es regex ".*libXXX\\.so$" * adb shell am broadcast -a com.bytedance.raphael.ACTION_STOP -f 0x01000000 * adb shell am broadcast -a com.bytedance.raphael.ACTION_PRINT -f 0x01000000 */ @@ -43,14 +43,14 @@ public void onReceive(Context ctx, Intent intent) { int getConfigs(String params) { if (TextUtils.isEmpty(params)) { - return Raphael.MAP64_MODE | Raphael.ALLOC_MODE | Raphael.DIFF_CACHE | 0xF0000 | 4096; + return Raphael.MAP64_MODE | Raphael.ALLOC_MODE | 0xF0000 | 4096; } try { return Integer.decode(params); } catch (NumberFormatException e) { e.printStackTrace(); - return Raphael.MAP64_MODE | Raphael.ALLOC_MODE | Raphael.DIFF_CACHE | 0xF0000 | 4096; + return Raphael.MAP64_MODE | Raphael.ALLOC_MODE | 0xF0000 | 4096; } }