You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several places in code you're using const std::string to define whitespace and end-of-line strings. There are a couple of issues with this.
First, these aren't inline, meaning that an instance is created for every translation unit.
Second, because you're using std::string, this performs an unnecessary allocation in debug mode (it disappears in release due to SSO). This is causing me problems with my leak detection, since the deallocation order isn't guaranteed, and is occurring after my leak check exit point.
It would be best to simply replace these several instances with inline const char* This will avoid any allocations, and works exactly like before.
Thanks for bringing this to my attention, I changed it to const char* const in the latest release. My compiler had issues with inline - I think it should be constexpr for inline. Either way this should optimize allocations.
There are several places in code you're using const std::string to define whitespace and end-of-line strings. There are a couple of issues with this.
First, these aren't inline, meaning that an instance is created for every translation unit.
Second, because you're using std::string, this performs an unnecessary allocation in debug mode (it disappears in release due to SSO). This is causing me problems with my leak detection, since the deallocation order isn't guaranteed, and is occurring after my leak check exit point.
It would be best to simply replace these several instances with
inline const char*
This will avoid any allocations, and works exactly like before.The text was updated successfully, but these errors were encountered: