diff --git a/kernel/freelist/free_performance/Malloc_free_performance.cpp b/kernel/freelist/free_performance/Malloc_free_performance.cpp index 7731248d..dcef3ac8 100644 --- a/kernel/freelist/free_performance/Malloc_free_performance.cpp +++ b/kernel/freelist/free_performance/Malloc_free_performance.cpp @@ -216,7 +216,7 @@ HWTEST_F(MallocFreePerformance, freeperformance0100, Function | MediumTest | Lev for (int j = 0; j < CLUSTER_SIZE; ++j) { ptr[j] = malloc(g_sizes[index]); if (!ptr[j]) { - printf("Malloc size of %u byte(s) failed: %s\n", g_sizes[index], strerror(errno)); + printf("Malloc size of %zu byte(s) failed: %s\n", g_sizes[index], strerror(errno)); } ++index; index %= SIZE_ARR_SIZE; diff --git a/kernel/freelist/malloc_pressure/Malloc_pressure.cpp b/kernel/freelist/malloc_pressure/Malloc_pressure.cpp index bf50c6b9..63e12e2f 100644 --- a/kernel/freelist/malloc_pressure/Malloc_pressure.cpp +++ b/kernel/freelist/malloc_pressure/Malloc_pressure.cpp @@ -63,7 +63,7 @@ HWTEST_F(MallocPressure, pressureTest0100, Function | MediumTest | Level1) for (size_t size = 0; size < THRESHOLD; size += SIZE_ALIGN + 1) { void *ptr = malloc(size); if (!ptr) { - printf("Malloc failed for size %u\n", size); + printf("Malloc failed for size %zu\n", size); ASSERT_TRUE(true) << "malloc error = " << errno; } free(ptr);