From da7cc602f980f688a4e8f1427bd3b9fd14b73dcc Mon Sep 17 00:00:00 2001 From: Lumos235 Date: Wed, 14 May 2025 01:57:46 +0000 Subject: [PATCH 1/4] update third_party/musl/ndk_musl_include/malloc.h. Signed-off-by: Lumos235 --- third_party/musl/ndk_musl_include/malloc.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/third_party/musl/ndk_musl_include/malloc.h b/third_party/musl/ndk_musl_include/malloc.h index 3601b2625..fb8b470cd 100644 --- a/third_party/musl/ndk_musl_include/malloc.h +++ b/third_party/musl/ndk_musl_include/malloc.h @@ -104,6 +104,18 @@ struct mallinfo2 { size_t keepcost; }; +/** + * @brief The function return a copy of a structure containing information about memory allocations performed by malloc(3) and related functions. + * @return struct mallinfo,a copy of a structure containing information about memory allocations. + */ +struct mallinfo mallinfo(void); + +/** + * @brief The function return a copy of a structure containing information about memory allocations performed by malloc(3) and related functions. + * @return struct mallinfo2,a copy of a structure containing information about memory allocations,which solves some of the arguments against including mallinfo by expanding the width of the returned counters from int to size_t. + */ +struct mallinfo2 mallinfo2(void); + #ifdef __cplusplus } #endif -- Gitee From 3cc8ad9287dfd37ca7ff2dd6510bc497edb113e2 Mon Sep 17 00:00:00 2001 From: Lumos235 Date: Wed, 14 May 2025 07:02:42 +0000 Subject: [PATCH 2/4] update third_party/musl/ndk_script/adapter/libc.ndk.json. Signed-off-by: Lumos235 --- third_party/musl/ndk_script/adapter/libc.ndk.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/third_party/musl/ndk_script/adapter/libc.ndk.json b/third_party/musl/ndk_script/adapter/libc.ndk.json index c1dfaf89d..b1808ff68 100644 --- a/third_party/musl/ndk_script/adapter/libc.ndk.json +++ b/third_party/musl/ndk_script/adapter/libc.ndk.json @@ -757,6 +757,8 @@ { "name": "madvise" }, { "name": "malloc" }, { "name": "mallopt" }, + { "name": "mallinfo" }, + { "name": "mallinfo2" }, { "name": "malloc_usable_size" }, { "name": "mblen" }, { "name": "mbrlen" }, -- Gitee From 58a120dcc72f8fec22773e20d6b66727ca885187 Mon Sep 17 00:00:00 2001 From: Lumos235 Date: Wed, 14 May 2025 08:16:23 +0000 Subject: [PATCH 3/4] update third_party/musl/ndk_musl_include/malloc.h. Signed-off-by: Lumos235 --- third_party/musl/ndk_musl_include/malloc.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/third_party/musl/ndk_musl_include/malloc.h b/third_party/musl/ndk_musl_include/malloc.h index fb8b470cd..70cf26b70 100644 --- a/third_party/musl/ndk_musl_include/malloc.h +++ b/third_party/musl/ndk_musl_include/malloc.h @@ -105,14 +105,15 @@ struct mallinfo2 { }; /** - * @brief The function return a copy of a structure containing information about memory allocations performed by malloc(3) and related functions. - * @return struct mallinfo,a copy of a structure containing information about memory allocations. + * @brief Obtains the memory information allocated by malloc-related operations. + * @return A mallinfo struct containing details about memory allocation. */ struct mallinfo mallinfo(void); /** - * @brief The function return a copy of a structure containing information about memory allocations performed by malloc(3) and related functions. - * @return struct mallinfo2,a copy of a structure containing information about memory allocations,which solves some of the arguments against including mallinfo by expanding the width of the returned counters from int to size_t. + * @brief Obtains the memory information allocated by malloc-related operations. + * @return A mallinfo2 struct containing details about memory allocation. Unlike mallinfo, this struct uses + * size_t for its counters, providing a larger range. */ struct mallinfo2 mallinfo2(void); -- Gitee From f25dbfed354c00da27bfb7ba33eb801aeacf758b Mon Sep 17 00:00:00 2001 From: Lumos235 Date: Thu, 15 May 2025 07:54:36 +0000 Subject: [PATCH 4/4] update third_party/musl/ndk_script/adapter/libc.ndk.json. Signed-off-by: Lumos235 --- third_party/musl/ndk_script/adapter/libc.ndk.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/third_party/musl/ndk_script/adapter/libc.ndk.json b/third_party/musl/ndk_script/adapter/libc.ndk.json index b1808ff68..f9a52a2fd 100644 --- a/third_party/musl/ndk_script/adapter/libc.ndk.json +++ b/third_party/musl/ndk_script/adapter/libc.ndk.json @@ -757,8 +757,14 @@ { "name": "madvise" }, { "name": "malloc" }, { "name": "mallopt" }, - { "name": "mallinfo" }, - { "name": "mallinfo2" }, + { + "first_introduced":"19", + "name": "mallinfo" + }, + { + "first_introduced":"19", + "name": "mallinfo2" + }, { "name": "malloc_usable_size" }, { "name": "mblen" }, { "name": "mbrlen" }, -- Gitee