[riot-notifications] [RIOT-OS/RIOT] sys/shell: add heap command (#10953)

Sebastian Meiling notifications at github.com
Tue Apr 16 08:11:41 CEST 2019


smlng requested changes on this pull request.

In general this is a good idea and edition to monitor mem usage, what I don't "like" about the implementation is code duplication for the `printf` and also the fact that the info is always printed.

I would recommend to rework/refine as follows:

- introduce a heap info struct holding the values, e.g.
```
typedef struct heap_info {
  unsigned size;
  unsigned free;
} heap_info_t;
```
- change `heap_stats` so it fills in that stuct, instead of printing it
- also change that function from `void` to `int` so you can indicate if heap stats are supported by this cpu, avoiding some of the `#ifdefs`
- use that new function in `sc_heap` to implement the `heap` command
  



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10953#pullrequestreview-226998918
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190415/ec806e85/attachment.html>


More information about the notifications mailing list