mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys/newlib: update heap_stats for multiple heaps
This commit is contained in:
parent
23c5d34284
commit
fd1052bc9a
@ -209,7 +209,12 @@ void *_sbrk_r(struct _reent *r, ptrdiff_t incr)
|
||||
__attribute__((weak)) void heap_stats(void)
|
||||
{
|
||||
struct mallinfo minfo = mallinfo();
|
||||
long int heap_size = &_eheap - &_sheap;
|
||||
long int heap_size = 0;
|
||||
|
||||
for (unsigned int i = 0; i < NUM_HEAPS; i++) {
|
||||
heap_size += heaps[i].end - heaps[i].start;
|
||||
}
|
||||
|
||||
printf("heap: %ld (used %d, free %ld) [bytes]\n",
|
||||
heap_size, minfo.uordblks, heap_size - minfo.uordblks);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user