4 ms·
There is an extra degree of indirection the optimizer has to get rid of. There is no extra pointer in the _Alias version. Whether this minor difference is relev
by sirwhinesalot 5y ago
There is an extra degree of indirection the optimizer has to get rid of. There is no extra pointer in the _Alias version. Whether this minor difference is relevant I'll leave to better informed people.
- zozbot234 5y agoIs there, though? AIUI there's no symbol created and no pointer when you declare a "static const int" at file scope. It's simple substitution, like a #define. So the question is why wouldn't a function label be the same.
- monocasa 5y agoThat's only an common optimization, not a guarantee, and it breaks down when you let that object or a pointer to that object leave the translation unit like you're suggesting.