未验证 提交 403de3e6 编写于 作者: O openharmony_ci 提交者: Gitee

!959 优化memtrace接口性能

Merge pull request !959 from 卢韬/master
......@@ -7,9 +7,19 @@
void memtrace(void* addr, size_t size, const char* tag, bool is_using)
{
#ifdef HOOK_ENABLE
volatile const struct MallocDispatchType* dispatch_table = get_current_dispatch_table();
volatile const struct MallocDispatchType* dispatch_table = (struct MallocDispatchType *)atomic_load_explicit(
&__musl_libc_globals.current_dispatch_table, memory_order_acquire);
if (__predict_false(dispatch_table != NULL)) {
dispatch_table->memtrace(addr, size, tag, is_using);
if (__get_memleak_hook_flag()) {
return;
}
if (!__get_global_hook_flag()) {
return;
}
else if (!__get_hook_flag()) {
return;
}
return dispatch_table->memtrace(addr, size, tag, is_using);
}
#endif
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册