String-interning at compiletime for profiling
问题 Context I am working on an instrumenting profiler, that enables you to name different measurements by string. So for example: MEASURE_SCOPE(text_rendering_code); ... MEASURE_SCOPE(password_hashing); ... MEASURE_START(system_call); ... MEASURE_STOP(system_call); where the macros would be defined like this: #define MEASURE_START(name) save_start_event(get_timestamp(), #name); #define MEASURE_STOP(name) save_stop_event(get_timestamp(), #name); #define MEASURE_SCOPE(name) Profiling_Class object#