Liste des Groupes | Revenir à cl c |
Am 27.08.2024 um 20:54 schrieb David Brown:And in small systems programming, much of the standard library /is/ omitted. When you are doing real-time or critical software, you avoid dynamic memory like the plague. The standard container classes (other than std::array<>) are inappropriate for most low-level or small-systems programming.
And you were completely wrong when you said that. Perhaps in /your/ field of programming you are correct - but you are ignoring the restYou've to omit nearly the whole standard libary to avoid exceptions.
of the world.
F.e. everything that has an allocator may throw bad_alloc.
No, it is not - function calls when the compiler cannot see, or cannot use, the definition of the called function can have significant overheads well above the cost of a dozen instructions. Virtual function calls add to that due to an extra layer of indirection. And many virtual functions are very small, simply reading or writing a variable.Often that is correct. Often it is /not/ correct.It's correct nearly every time since usually you've more than a dozen
instructions in a virtual function.
No, they don't. The Cortex-M cores do not have branch prediction. Some have static speculative prefetch of branch targets from flash to reduce the delay on branch, but no more than that. These are not out-of-order processors, they have no speculative execution, and only the Cortex-M7 is superscalar (slightly). This is, of course, a benefit - the cores are intended to be small and low power, and to have consistent execution times rather than maximal average throughput.For every one of your favourite big x86 chips sold, there will be a hundred small microcontrollers - none of which has branch prediction.Even the simple Cortex CPUs have a branch prediciton.
Les messages affichés proviennent d'usenet.