提交 466c15e9 编写于 作者: Z zgq-0218

FIX the cppcrash caused by the null pointer in mallopt when HOOK_ENABLE

delete the mallopt interface in hook

Issue:I6IOR3
Test:Pass
Signed-off-by: Nzgq-0218 <zhaoguoqiang8@huawei.com>
上级 a31ed2a6
...@@ -98,14 +98,4 @@ size_t malloc_usable_size(void* addr) ...@@ -98,14 +98,4 @@ size_t malloc_usable_size(void* addr)
return MuslMalloc(malloc_usable_size)(addr); return MuslMalloc(malloc_usable_size)(addr);
} }
} }
int mallopt(int param, int value)
{
volatile const struct MallocDispatchType* dispatch_table = get_current_dispatch_table();
if (__predict_false(dispatch_table != NULL)) {
return dispatch_table->mallopt(param, value);
} else {
return MuslMalloc(mallopt)(param, value);
}
}
#endif #endif
...@@ -463,11 +463,7 @@ int is_allzero(void *p) ...@@ -463,11 +463,7 @@ int is_allzero(void *p)
get_stride(g) < UNIT*size_classes[g->sizeclass]; get_stride(g) < UNIT*size_classes[g->sizeclass];
} }
#ifdef HOOK_ENABLE
int __libc_mallopt(int param, int value)
#else
int mallopt(int param, int value) int mallopt(int param, int value)
#endif
{ {
#ifdef USE_JEMALLOC_DFX_INTF #ifdef USE_JEMALLOC_DFX_INTF
return je_mallopt(param, value); return je_mallopt(param, value);
...@@ -500,4 +496,4 @@ int malloc_iterate(void* base, size_t size, void (*callback)(void* base, size_t ...@@ -500,4 +496,4 @@ int malloc_iterate(void* base, size_t size, void (*callback)(void* base, size_t
ssize_t malloc_backtrace(void* pointer, uintptr_t* frames, size_t frame_count) ssize_t malloc_backtrace(void* pointer, uintptr_t* frames, size_t frame_count)
{ {
return 0; return 0;
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册