// SPDX-License-Identifier: MPL-2.0 #include "kernel/tests/test_malloc.h" #include "kernel/tests/test_utils.h" #include "kernel/tests/payloads/test_malloc_payload.h" #include "kernel/log.h" #include "memory/page.h" #include "std/mem.h" #include "std/malloc.h" static sh_uint64 iter_num=10000; __attribute__((section(".bss"))) static sh_uint64 address_list[10000]; SH_STATUS sh_test_malloc_benchmark() { sh_tsc_TSC_VALUE *tsc_value=sh_test_get_tsc_values_buffer_ptr(); sh_mem_set_8((sh_uint8*)tsc_value,0x00,10000*sizeof(sh_tsc_TSC_VALUE)); sh_mem_set_8((sh_uint8*)address_list,0x00,sizeof(address_list)); sh_log_test("Benchmarking Malloc subsystem..."); sh_tsc_TSC_VALUE start=0; sh_tsc_TSC_VALUE end=0; for (sh_iter64 i=0;i