Bob is noticing that his compiled program size is much larger than expected after he marked several lengthy functions as inline. What could be a reason for this?
- Code Duplication
- Compiler Optimization
- Linker Error
- Memory Leaks
One reason for Bob's compiled program size to increase after marking lengthy functions as inline is code duplication. When functions are marked as inline, their code is replicated at each call site. If the function is lengthy and called from multiple places, this can lead to increased code size. It's essential to strike a balance between inlining for performance and avoiding excessive code duplication.
Loading...
Related Quiz
- Regarding memory alignment and data packing, which of the following is true for structs in C++?
- Which keyword is used to inherit a class in C++?
- What will happen if a function does not return a value but has a return type other than void?
- How would you implement a loop that executes a specific number of times and uses an iterator?
- What potential issue might arise when using switch-case statements with enumerated types?