Memory consumption of const and enum

After a few years of being relaxed on memory requirements (thanks to the dramatic expansion of available code and ram space) we’re again reaching 90% on code so some refactoring is in order.

Question : we’re now default linking in a large number of enums and consts that are not necessarily all needed for the device code (shared between device and agent now). Do these eventually take up code or memory space, or is that ‘compiled out’ ?

They should be compiled out. Unless your code uses any of the constants, their values won’t be substituted in. That’s certainly the case for consts; pretty sure it’s true for enums too.