diff --git a/tests/lib/heap/prj.conf b/tests/lib/heap/prj.conf index a41fd3e0788..dd9186e6a50 100644 --- a/tests/lib/heap/prj.conf +++ b/tests/lib/heap/prj.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_SYS_HEAP_VALIDATE=y +CONFIG_SYS_HEAP_RUNTIME_STATS=y diff --git a/tests/lib/heap/src/main.c b/tests/lib/heap/src/main.c index 316f639d6cf..1851f236bf2 100644 --- a/tests/lib/heap/src/main.c +++ b/tests/lib/heap/src/main.c @@ -38,7 +38,16 @@ #define BIG_HEAP_SZ MIN(256 * 1024, MEMSZ / 3) #define SMALL_HEAP_SZ MIN(BIG_HEAP_SZ, 2048) + +/* With enabling SYS_HEAP_RUNTIME_STATS, the size of struct z_heap + * will increase 16 bytes on 64 bit CPU. + */ +#ifdef CONFIG_SYS_HEAP_RUNTIME_STATS +#define SOLO_FREE_HEADER_HEAP_SZ (80) +#else #define SOLO_FREE_HEADER_HEAP_SZ (64) +#endif + #define SCRATCH_SZ (sizeof(heapmem) / 2) /* The test memory. Make them pointer arrays for robust alignment diff --git a/tests/lib/heap_align/prj.conf b/tests/lib/heap_align/prj.conf index a41fd3e0788..dd9186e6a50 100644 --- a/tests/lib/heap_align/prj.conf +++ b/tests/lib/heap_align/prj.conf @@ -1,2 +1,3 @@ CONFIG_ZTEST=y CONFIG_SYS_HEAP_VALIDATE=y +CONFIG_SYS_HEAP_RUNTIME_STATS=y