Implement pedantic shutdown options for gamelogic processes#3327
Implement pedantic shutdown options for gamelogic processes#3327slipher merged 2 commits intoUnvanquished:masterfrom
Conversation
|
Just a style remark, for this kind of code: #ifndef BUILD_VM_IN_PROCESS
static Cvar::Cvar<bool> cg_pedanticShutdown("cg_pedanticShutdown",
"run useless shutdown procedures in cgame process",
Cvar::NONE,
#ifdef USING_SANITIZER
true);
#else
false);
#endif
#endifI prefer it written this way (no preprocessor in the middle of something): #ifndef BUILD_VM_IN_PROCESS
#ifdef USING_SANITIZER
static const bool defaultPedanticShutdown = true;
#else
static const bool defaultPedanticShutdown = false;
#endif
static Cvar::Cvar<bool> cg_pedanticShutdown("cg_pedanticShutdown",
"run useless shutdown procedures in cgame process",
Cvar::NONE, defaultPedanticShutdown);
#endif…and even GitHub syntax coloring prefers it as well. See also: At the time I also noticed that VIM also prefers it that way. And outside of coloring, this makes easier to read the code. |
|
Personally my reaction is that those syntax highlighters should git gud. But I will do it if you give me LGTM modulo the style comment 😛 |
Is this blackmail? 😛 LGTM modulo the style comment anyway, that syntax is the only thing I have something to say against. |
|
Note that my new lines in my examples are not part of my recommendation, it's just to workaroud GitHub not wrapping lines and keep my comments readable. This is fine: #ifndef BUILD_VM_IN_PROCESS
#ifdef USING_SANITIZER
static const bool defaultPedanticShutdown = true;
#else
static const bool defaultPedanticShutdown = false;
#endif
static Cvar::Cvar<bool> cg_pedanticShutdown("cg_pedanticShutdown", "run useless shutdown procedures in cgame process", Cvar::NONE, defaultPedanticShutdown);
#endif // !BUILD_VM_IN_PROCESS |
|
I guess every second spent on thinking about Github's current code rendering is a waste of human resources. |
|
fwiw, my human brain also prefers: otherwise, lgtm % style nit |
When g_pedanticShutdown/cg_pedanticShutdown is off (default) and the gamelogic is running in a separate process, skip shutdown code whose only purpose is to deallocate memory. This saves time and avoids spamming anyone with shutdown errors in production for cleanup issues like with Lua (Unvanquished#3078) or RmlUi (Unvanquished#1693).
4e18630 to
528ca06
Compare
When
g_pedanticShutdown/cg_pedanticShutdownis off (default) and the gamelogic is running in a separate process, skip shutdown code whose only purpose is to deallocate memory. This saves time and avoids spamming anyone with shutdown errors in production for cleanup issues like with Lua (#3078) or RmlUi (#1693).