Skip to content

Commit

Permalink
切换成c++_static
Browse files Browse the repository at this point in the history
  • Loading branch information
shentianzhou committed Apr 29, 2021
1 parent 28ab399 commit 8df3bb5
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
```

Expand Down
2 changes: 1 addition & 1 deletion README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
```

Expand Down
4 changes: 2 additions & 2 deletions demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
3 changes: 2 additions & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apply plugin: 'com.github.dcendents.android-maven'

android {
compileSdkVersion 28

defaultConfig {
minSdkVersion 14
targetSdkVersion 28
Expand All @@ -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"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions library/src/main/cpp/MemoryCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <unknown>\n"
#define STACK_FORMAT_ANONYMOUS "0x%016lx <anonymous:%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 <unknown>\n"
#define STACK_FORMAT_ANONYMOUS "0x%08x <anonymous:%08x>\n"
#define STACK_FORMAT_FILE "0x%08x %s\n"
Expand Down
1 change: 0 additions & 1 deletion library/src/main/cpp/Raphael.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

#define MAP64_MODE 0x00800000
#define ALLOC_MODE 0x00400000
#define CACHE_MASK 0x00200000
#define DEPTH_MASK 0x001F0000
#define LIMIT_MASK 0x0000FFFF

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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;
}
}

Expand Down

0 comments on commit 8df3bb5

Please sign in to comment.