mirror of
https://gitee.com/openharmony/xts_hats
synced 2025-01-22 08:39:37 +00:00
修改kernel下编译问题
Signed-off-by: limeng151 <limeng151@huawei.com> Change-Id: Ib166d4c378e3b5fc8c73f6f7bad29a47c0605cc1
This commit is contained in:
parent
a146a3f1d2
commit
b2518f15d5
@ -216,7 +216,7 @@ HWTEST_F(MallocFreePerformance, freeperformance0100, Function | MediumTest | Lev
|
|||||||
for (int j = 0; j < CLUSTER_SIZE; ++j) {
|
for (int j = 0; j < CLUSTER_SIZE; ++j) {
|
||||||
ptr[j] = malloc(g_sizes[index]);
|
ptr[j] = malloc(g_sizes[index]);
|
||||||
if (!ptr[j]) {
|
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;
|
||||||
index %= SIZE_ARR_SIZE;
|
index %= SIZE_ARR_SIZE;
|
||||||
|
@ -63,7 +63,7 @@ HWTEST_F(MallocPressure, pressureTest0100, Function | MediumTest | Level1)
|
|||||||
for (size_t size = 0; size < THRESHOLD; size += SIZE_ALIGN + 1) {
|
for (size_t size = 0; size < THRESHOLD; size += SIZE_ALIGN + 1) {
|
||||||
void *ptr = malloc(size);
|
void *ptr = malloc(size);
|
||||||
if (!ptr) {
|
if (!ptr) {
|
||||||
printf("Malloc failed for size %u\n", size);
|
printf("Malloc failed for size %zu\n", size);
|
||||||
ASSERT_TRUE(true) << "malloc error = " << errno;
|
ASSERT_TRUE(true) << "malloc error = " << errno;
|
||||||
}
|
}
|
||||||
free(ptr);
|
free(ptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user