@@ -343,7 +343,7 @@ void heap_print_info(struct z_heap *h, bool dump_chunks)
343343 if (count ) {
344344 printk ("%9d %12d %12d %12zd %12zd\n" ,
345345 i , (1 << i ) - 1 + min_chunk_size (h ), count ,
346- largest , largest * CHUNK_UNIT - chunk_header_bytes ( h ));
346+ largest , chunksz_to_bytes ( h , largest ));
347347 }
348348 }
349349
@@ -355,11 +355,9 @@ void heap_print_info(struct z_heap *h, bool dump_chunks)
355355 if (c == 0 || c == h -> end_chunk ) {
356356 /* those are always allocated for internal purposes */
357357 } else if (chunk_used (h , c )) {
358- allocated_bytes += chunk_size (h , c ) * CHUNK_UNIT
359- - chunk_header_bytes (h );
358+ allocated_bytes += chunksz_to_bytes (h , chunk_size (h , c ));
360359 } else if (!solo_free_header (h , c )) {
361- free_bytes += chunk_size (h , c ) * CHUNK_UNIT
362- - chunk_header_bytes (h );
360+ free_bytes += chunksz_to_bytes (h , chunk_size (h , c ));
363361 }
364362 if (dump_chunks ) {
365363 printk ("chunk %4zd: [%c] size=%-4zd left=%-4zd right=%zd\n" ,
0 commit comments