←back to thread

327 points AareyBaba | 1 comments | | HN request time: 0.202s | source
Show context
mwkaufma ◴[] No.46183728[source]
TL;DR

- no exceptions

- no recursion

- no malloc()/free() in the inner-loop

replies(9): >>46183820 #>>46183900 #>>46184073 #>>46184113 #>>46184198 #>>46184398 #>>46184472 #>>46184588 #>>46185500 #
wiseowise ◴[] No.46183900[source]
That’s hardly 90% of C++.
replies(2): >>46183975 #>>46184047 #
elteto ◴[] No.46184047[source]
If you compile with -fno-exceptions you just lost almost all of the STL.

You can compile with exceptions enabled, use the STL, but strictly enforce no allocations after initialization. It depends on how strict is the spec you are trying to hit.

replies(2): >>46184298 #>>46184314 #
vodou ◴[] No.46184298[source]
Not my experience. I work with a -fno-exceptions codebase. Still quite a lot of std left. (Exceptions come with a surprisingly hefty binary size cost.)
replies(2): >>46184320 #>>46184674 #
theICEBeardk ◴[] No.46184320[source]
Apparently according to some ACCU and CPPCon talks by Khalil Estel this can be largely mitigated even in embedded lowering the size cost by orders of magnitude.
replies(2): >>46184444 #>>46184552 #
1. Espressosaurus ◴[] No.46184444[source]
Yeah. I unfortunately moved to an APU where code size isn't an issue so I never got the chance to see how well that analysis translated to the work I do.

Provocative talk though, it upends one of the pillars of deeply embedded programming, at least from a size perspective.