User avatar
mia (developer mode)
@mia@shrimptest.0x0.st
@navi i mean it’s pretty simple right?

in executable program code: okay if you keep it tidy. not like it’s gonna hurt anybody. minimizing the number of code paths that access globals directly is probably prudent, especially if the program grows a little bigger than expected (not much of an issue with TU-local state)

in library code: not acceptable except for things like memoizing CPUID flag checks for runtime SIMD dispatch (i.e. what you can reasonably assume to yield de facto constant results even if the code is, intentionally or not, concurrently used multiple times in the same executable)