forked from lolo859/vystem
Vystem 0.2
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
#include "kernel/tests/payloads/test_malloc_payload.h"
|
||||
#include "kernel/log.h"
|
||||
#include "memory/page.h"
|
||||
#include "memory/heap.h"
|
||||
#include "std/mem.h"
|
||||
#include "std/malloc.h"
|
||||
static sh_uint64 iter_num=10000;
|
||||
@@ -30,7 +29,7 @@ SH_STATUS sh_test_malloc_benchmark() {
|
||||
return SH_STATUS_TEST_FAILED;
|
||||
}
|
||||
}
|
||||
sh_test_compute_print_stats("sh_malloc for small size",tsc_value,iter_num);
|
||||
sh_test_compute_print_stats("sh_malloc for small size",tsc_value,iter_num,SH_FALSE);
|
||||
sh_mem_set_8((sh_uint8*)tsc_value,0x00,10000*sizeof(sh_tsc_TSC_VALUE));
|
||||
for (sh_iter64 i=0;i<iter_num;i++) {
|
||||
start=sh_tsc_get_kernel_current_tsc();
|
||||
@@ -45,7 +44,7 @@ SH_STATUS sh_test_malloc_benchmark() {
|
||||
return SH_STATUS_TEST_FAILED;
|
||||
}
|
||||
}
|
||||
sh_test_compute_print_stats("sh_free for small size",tsc_value,iter_num);
|
||||
sh_test_compute_print_stats("sh_free for small size",tsc_value,iter_num,SH_FALSE);
|
||||
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_uint16 alloc_count=0;
|
||||
@@ -85,8 +84,8 @@ SH_STATUS sh_test_malloc_benchmark() {
|
||||
}
|
||||
}
|
||||
}
|
||||
sh_test_compute_print_stats("sh_malloc for pages allocations",tsc_value,alloc_count);
|
||||
sh_test_compute_print_stats("sh_free for pages allocations",tsc_value+1000,free_count-1000);
|
||||
sh_test_compute_print_stats("sh_malloc for pages allocations",tsc_value,alloc_count,SH_FALSE);
|
||||
sh_test_compute_print_stats("sh_free for pages allocations",tsc_value+1000,free_count-1000,SH_FALSE);
|
||||
sh_log_mem_stats(SH_LOG_SOURCE_TEST);
|
||||
return SH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user