-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iostream support blows up binary size and RAM requirements #32
Comments
Refer to issue nholthaus#32 for more details: nholthaus#32
Refer to issue nholthaus#32 for more details: nholthaus#32
I'm all about supporting embedded. I'd tacitly assumed that the template meta-programming would blow up small microprocessors, so I originally wasn't worried about In terms of the implementation I think I'd prefer to see I also agree about the macros. I think they need to be refactored such that I can work on this and get it into v2.2, unless you'd prefer to make the changes. |
No problem, I'll refactor a bit based on your suggestions and send a patch tomorrow! |
This is being tackled in PR #42 now. |
Currently iostream support is unconditionally enabled. This is fine for desktop targets but not for small embedded targets with limited flash storage and RAM. For instance on the Nordic nRF51 based on ARM Cortex-M0+, approx 150kB flash and 6.5kB of extra RAM is used, on a device which only has 256kB flash and 8kB RAM.
Disabling iostream support will go a long way in supporting embedded targets.
The following patch (against v2.2.x branch) adds a #define to enable/disable iostream:
https://gist.github.com/pvaibhav/c3703bf23c8513f4a8160eed524a415d
I've verified disabling iostream results in zero impact on the compiled binary size or RAM usage.
I'll create a pull request from this patch if there is any interest. My only concern is the duplication of UNIT_ADD definition, once with and once without iostream. An intermediate macro could perhaps help here.
The text was updated successfully, but these errors were encountered: