3 ms·
Removing `const char* wuffs_base__note__i_o_redirect = "@base: I/O redirect";` removes not only the literal string, but also a global non-constant pointer. This
by kjgkjhfkjf 6y ago
Removing `const char* wuffs_base__note__i_o_redirect = "@base: I/O redirect";` removes not only the literal string, but also a global non-constant pointer. This perhaps affects various optimizations.
They should have used `const char* wuffs_base__note__i_o_redirect const =` or (preferably) `const char wuffs_base__note__i_o_redirect[] =`.
- tom_mellior 6y agoI can't think of a plausible way in which an unused global would affect compiler optimizations. Could you elaborate?
- HelloNurse 6y agoThe pointer probably precedes interesting variables in the same data segment, which therefore shift to a different address that is cached differently.
- tom_mellior 6y agoSure, but that's not a compiler optimization issue. The compiler will emit the same instructions, they will just execute at a different speed if the data is elsewhere.