提交 f7187fbd 编写于 作者: Z zhang-cui11

Malloc hook instruction optimization

Signed-off-by: Nzhang-cui11 <zhangcui11@huawei.com>
上级 c09d0343
...@@ -730,14 +730,14 @@ template("musl_libs") { ...@@ -730,14 +730,14 @@ template("musl_libs") {
"//build/config/compiler:compiler", "//build/config/compiler:compiler",
":soft_hook", ":soft_hook",
] ]
}
cflags = [ cflags = [
"-mllvm", "-mllvm",
"--instcombine-max-iterations=0", "--instcombine-max-iterations=0",
"-ffp-contract=fast", "-ffp-contract=fast",
"-O3", "-O3",
] ]
}
source_set("soft_musl_jemalloc") { source_set("soft_musl_jemalloc") {
sources = [ "./porting/linux/user/src/malloc/jemalloc/jemalloc.c" ] sources = [ "./porting/linux/user/src/malloc/jemalloc/jemalloc.c" ]
......
...@@ -18,7 +18,7 @@ void* malloc(size_t bytes) ...@@ -18,7 +18,7 @@ void* malloc(size_t bytes)
if (!__get_global_hook_flag()) { if (!__get_global_hook_flag()) {
return MuslFunc(malloc)(bytes); return MuslFunc(malloc)(bytes);
} }
else if (!__get_hook_flag()) { if (!__get_hook_flag()) {
return MuslFunc(malloc)(bytes); return MuslFunc(malloc)(bytes);
} }
return dispatch_table->malloc(bytes); return dispatch_table->malloc(bytes);
...@@ -39,7 +39,7 @@ void free(void* mem) ...@@ -39,7 +39,7 @@ void free(void* mem)
MuslFunc(free)(mem); MuslFunc(free)(mem);
return; return;
} }
else if (!__get_hook_flag()) { if (!__get_hook_flag()) {
MuslFunc(free)(mem); MuslFunc(free)(mem);
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册