Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
660ff83b
T
Third Party Musl
项目概览
OpenHarmony
/
Third Party Musl
1 年多 前同步成功
通知
37
Star
125
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Musl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
660ff83b
编写于
12月 06, 2022
作者:
weixin_45937718
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
2
Signed-off-by:
zhengkaijie
<
2658880633@qq.com
>
上级
d5ecd1d0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
5 deletion
+7
-5
porting/linux/user/src/hook/musl_preinit.c
porting/linux/user/src/hook/musl_preinit.c
+6
-4
porting/linux/user/src/hook/musl_preinit_common.h
porting/linux/user/src/hook/musl_preinit_common.h
+1
-1
未找到文件。
porting/linux/user/src/hook/musl_preinit.c
浏览文件 @
660ff83b
...
...
@@ -69,7 +69,7 @@ static void get_native_hook_param(char *buf, unsigned int buf_len)
#ifdef OHOS_ENABLE_PARAMETER
const
char
*
key
=
MUSL_HOOK_PARAM_NAME
;
unsigned
int
len
=
buf_len
;
(
void
)
SystemReadParam
(
k
MemTrackPropertyEnable
,
__memleak_param_value
,
&
len
);
(
void
)
SystemReadParam
(
k
ey
,
buf
,
&
len
);
#else
return
;
#endif
...
...
@@ -376,7 +376,8 @@ bool finish_install_ohos_malloc_hooks(struct musl_libc_globals* globals, const c
}
atomic_store_explicit
(
&
__musl_libc_globals
.
so_dispatch_table
,
(
volatile
long
long
)
&
globals
->
malloc_dispatch_table
,
memory_order_seq_cst
);
atomic_store_explicit
(
&
__musl_libc_globals
.
current_dispatch_table
,
(
volatile
long
long
)
&
globals
->
malloc_dispatch_table
,
memory_order_seq_cst
);
}
else
if
(
__get_memleak_hook_flag
()
&&
checkLoadMallocMemTrack
)
{
}
if
(
__get_memleak_hook_flag
()
&&
checkLoadMallocMemTrack
)
{
if
(
!
start_func
(
memLeakTypeContent
))
{
clear_function_table
();
return
false
;
...
...
@@ -437,7 +438,7 @@ static void* init_ohos_malloc_hook()
install_ohos_malloc_hook
(
&
__musl_libc_globals
,
kMemTrackSharedLib
,
kMemTrackPrefix
);
}
}
if
(
__get_global_hook_flag
())
if
(
__get_global_hook_flag
())
{
install_ohos_malloc_hook
(
&
__musl_libc_globals
,
__malloc_hook_shared_lib
,
__malloc_hook_function_prefix
);
}
return
NULL
;
...
...
@@ -554,7 +555,8 @@ static void __install_memleak_tracker_hook(int32_t sigNum, siginfo_t *info, void
atomic_store_explicit
(
&
__musl_libc_globals
.
current_dispatch_table
,
(
volatile
long
long
)
memleak_tracker_so_dispatch_value
,
memory_order_seq_cst
);
}
if
(
start_func
&&
!
start_func
(
memLeakTypeContent
))
{
// __musl_log(__MUSL_LOG_ERROR, "%s: failed to enable malloc\n", getprogname());
// __musl_log(__MUSL_LOG_ERROR, "%s: failed to enable malloc\n", getprogname());
clear_function_table
();
}
if
(
memLeakTypeContent
&
ADDR_NATIVE_ENABLE
)
{
atomic_store_explicit
(
&
__memleak_hook_flag
,
(
volatile
bool
)
false
,
memory_order_seq_cst
);
...
...
porting/linux/user/src/hook/musl_preinit_common.h
浏览文件 @
660ff83b
...
...
@@ -109,7 +109,7 @@ inline volatile const struct MallocDispatchType* get_current_dispatch_table()
#ifdef HOOK_ENABLE
volatile
const
struct
MallocDispatchType
*
ret
=
(
struct
MallocDispatchType
*
)
atomic_load_explicit
(
&
__musl_libc_globals
.
current_dispatch_table
,
memory_order_acquire
);
if
(
ret
!=
NULL
)
{
if
(
checkLoadMallocMemTrack
)
{
if
(
__get_memleak_hook_flag
()
)
{
return
ret
;
}
if
(
!
__get_global_hook_flag
())
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录