Commit cd475ca0 authored by Bartosz Podrygajlo's avatar Bartosz Podrygajlo

Optimize T_ID() macro

This changes the way T_IDs are defined. The T_ID macro was using a integer to pointer cast in
order to provide type safety. This trick disables some compiler optimizations, as explained
here: https://clang.llvm.org/extra/clang-tidy/checks/performance/no-int-to-ptr.html.
Removing the type cast reenables the compiler optimizations.
parent 65d8d410
......@@ -92,7 +92,11 @@
struct T_header;
/* to define message ID */
#ifdef CHECK_T_TYPE
#define T_ID(x) ((struct T_header *)(uintptr_t)(x))
#else
#define T_ID(x) x
#endif
/* T macro tricks */
extern int T_stdout;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment