fossa icon indicating copy to clipboard operation
fossa copied to clipboard

Make fossa friendlier for embedded systems

Open cpq opened this issue 9 years ago • 4 comments

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

cpq avatar Jul 06 '15 14:07 cpq

:+1:

danielinux avatar Jul 06 '15 15:07 danielinux

@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

danielinux avatar Jul 14 '15 08:07 danielinux

Yep. Added that point. I think that would be automatically done if CI on a small board.

cpq avatar Jul 14 '15 13:07 cpq

thanks!

danielinux avatar Jul 14 '15 13:07 danielinux