From bbcef13f1be41d604447070e13b369d3ff82e61f Mon Sep 17 00:00:00 2001 From: shuxinyia Date: Thu, 21 Jul 2022 11:35:28 +0800 Subject: [PATCH] =?UTF-8?q?=20=20=20=20=20=E4=BF=AE=E6=94=B9musl=20?= =?UTF-8?q?=E8=A7=A3=E5=86=B3TDD=20=E6=B5=8B=E8=AF=95=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82=20=20=20=20=20=20Signed-of?= =?UTF-8?q?f-by:shuxinyiA=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shuxinyia --- .../linux/user/src/hook/musl_preinit_common.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/porting/linux/user/src/hook/musl_preinit_common.h b/porting/linux/user/src/hook/musl_preinit_common.h index a6916096..63703338 100755 --- a/porting/linux/user/src/hook/musl_preinit_common.h +++ b/porting/linux/user/src/hook/musl_preinit_common.h @@ -39,18 +39,13 @@ extern "C" { __attribute__((always_inline)) inline bool __get_global_hook_flag() { -#ifdef HOOK_ENABLE volatile bool g_flag = atomic_load_explicit(&__hook_enable_hook_flag, memory_order_acquire); return g_flag; -#else - return false; -#endif } __attribute__((always_inline)) inline bool __get_hook_flag() { -#ifdef HOOK_ENABLE volatile void* impl_handle = (void *)atomic_load_explicit(&ohos_malloc_hook_shared_liibrary, memory_order_acquire); if (impl_handle == NULL) { return false; @@ -63,15 +58,11 @@ inline bool __get_hook_flag() bool flag = get_hook_func_ptr(); return flag; } -#else - return false; -#endif } __attribute__((always_inline)) inline bool __set_hook_flag(bool flag) { -#ifdef HOOK_ENABLE volatile void* impl_handle = (void *)atomic_load_explicit(&ohos_malloc_hook_shared_liibrary, memory_order_acquire); if (impl_handle == NULL) { return false; @@ -83,15 +74,11 @@ inline bool __set_hook_flag(bool flag) SetHookFlagType set_hook_func_ptr = (SetHookFlagType)(function_of_shared_lib[SET_HOOK_FLAG_FUNCTION]); return set_hook_func_ptr(flag); } -#else - return false; -#endif } __attribute__((always_inline)) 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 (!__get_global_hook_flag()) { @@ -102,9 +89,6 @@ inline volatile const struct MallocDispatchType* get_current_dispatch_table() } } return ret; -#else - return NULL; -#endif } #define MUSL_HOOK_PARAM_NAME "libc.hook_mode" -- GitLab