fossa
fossa copied to clipboard
Make fossa friendlier for embedded systems
FYI @danielinux & @maximevince
The primary fossa use case is embedded. However, when modules's functionality is getting extended, we unintentionally leak functions into the core, making it fatter. We need to make sure that our development does not increase core size, unless intended.
- [ ] Disable all modules by default. Let user explicitly enable those which are needed
- [ ] Make minimal fossa build on a small board (e.g. Arduino UNO)
- [ ] Setup CI with embedded fossa build, making sure we're not bloating the code
- [ ] No big objects on stack
:+1:
@cpq I would also add:
- [ ] Avoid placing big objects in the stack.
When big objects are placed in the stack of an embedded system, most likely it will result in a stack overflow. E.g., the struct ctl_msg
has a default size of 8198 bytes (!) on 32-bit, and it's placed in the stack when entering ns_mgr_handle_ctl_sock
.
I suggest to change the default size of stack objects - or even better - rework the code so that big objects are allocated onto the heap instead.
CC: @maximevince
Yep. Added that point. I think that would be automatically done if CI on a small board.
thanks!