修改kernel下编译问题

Signed-off-by: limeng151 <limeng151@huawei.com>
Change-Id: Ib166d4c378e3b5fc8c73f6f7bad29a47c0605cc1
This commit is contained in:
limeng151 2022-10-24 15:05:47 +08:00
parent a146a3f1d2
commit b2518f15d5
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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);