Closed PetervdPerk-NXP closed 3 years ago
If you look at the description of peak_request_size
, it says: "not including the rounding and the allocator's own per-fragment overhead, so the total is larger". But the docs for allocated
say: "including the per-fragment overhead and size alignment. For example, if the application requested a fragment of size 1 byte, the value reported here may be 32 bytes."
When you request, say, 200 bytes of memory, the allocator gives you 256 - O1HEAP_ALIGNMENT
bytes. This extra memory is included in the peak_allocated
but not peak_request_size
.
I've implemented a status message in my application to keep track of the O1Heap I'm using but I've noticed that the diagnostics function reports that peak_allocated is greater then peak_request_size.
INFO [uavcan_v1] Heap status 64/8000 Peak alloc 896 Peak req 256 OOM count 0
I would've expected them to be equal or that peak_request_size would be greater then peak_allocated. Is there a technical reason why this occurs?