The allocated_bytes were missing the allocation metadata. Because of that the sum of free_bytes and allocated_bytes doesn't remain constant after each allocation. This convention doesn't match glibc's behavior. This commit changes the chunksz_to_bytes function to include the metadata in the calculation. The analysis of the mallinfo2 function from glibc has been done in #92392 Pull Request. Signed-off-by: Krzysztof Sychla <ksychla@antmicro.com>
21 lines
475 B
YAML
21 lines
475 B
YAML
sample:
|
|
description: System heap sample showing how to use sys_heap functions
|
|
name: Basic system heap sample
|
|
common:
|
|
integration_platforms:
|
|
- native_sim
|
|
harness: console
|
|
harness_config:
|
|
type: multi_line
|
|
ordered: true
|
|
regex:
|
|
- ".*allocated 16.,.*"
|
|
- ".*allocated 1..,.*"
|
|
- ".*allocated 0, free ..., max allocated ..., heap size 256.*"
|
|
tests:
|
|
sample.basic.sys_heap:
|
|
tags:
|
|
- heap
|
|
- statistics
|
|
- dynamic_memory
|